Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: tools/clang/blink_gc_plugin/CMakeLists.txt

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tcmalloc/vendor/packages/rpm/rpm.spec ('k') | tools/clang/blink_gc_plugin/tests/.gitignore » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/CMakeLists.txt
diff --git a/tools/clang/blink_gc_plugin/CMakeLists.txt b/tools/clang/blink_gc_plugin/CMakeLists.txt
index 7f1dee3dab3bca9c17f75905560db3c3880a549c..590a3b7e4ddee49ec0430f5371b78865be324883 100644
--- a/tools/clang/blink_gc_plugin/CMakeLists.txt
+++ b/tools/clang/blink_gc_plugin/CMakeLists.txt
@@ -1,19 +1,41 @@
-# This line is read by update.sh and other scripts in tools/clang/scripts
-# Note: The spaces are significant.
set(LIBRARYNAME BlinkGCPlugin)
-add_llvm_loadable_module("lib${LIBRARYNAME}"
- BlinkGCPlugin.cpp
- Edge.cpp
- RecordInfo.cpp
- )
+set(plugin_sources
+ BlinkGCPlugin.cpp
+ Edge.cpp
+ RecordInfo.cpp)
-add_dependencies("lib${LIBRARYNAME}" clang)
+if(WIN32)
+ # Clang doesn't support loadable modules on Windows. Unfortunately, building
+ # the plugin as a static library and linking clang against it doesn't work.
+ # Since clang doesn't reference any symbols in our static library, the linker
+ # strips it out completely.
+ # Instead, we rely on the fact that the SOURCES property of a target is no
+ # read-only after CMake 3.1 and use it to compile the plugin directly into
+ # clang...
+ cmake_minimum_required(VERSION 3.1)
+ # Paths must be absolute, since we're modifying a target in another directory.
+ set(absolute_sources "")
+ foreach(source ${plugin_sources})
+ list(APPEND absolute_sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
+ endforeach()
+ set_property(TARGET clang APPEND PROPERTY SOURCES ${absolute_sources})
-cr_install(TARGETS "lib${LIBRARYNAME}" LIBRARY DESTINATION lib)
+ cr_add_test(blink_gc_plugin_test
+ python
+ ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.py
+ ${CMAKE_BINARY_DIR}/bin/clang
+ )
+else()
+ add_llvm_loadable_module("lib${LIBRARYNAME}" ${plugin_sources})
+ add_dependencies("lib${LIBRARYNAME}" clang)
-cr_add_test(blink_gc_plugin_test
- ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.sh
- ${CMAKE_BINARY_DIR}/bin/clang
- $<TARGET_FILE:lib${LIBRARYNAME}>
- )
+ cr_install(TARGETS "lib${LIBRARYNAME}" LIBRARY DESTINATION lib)
+
+ cr_add_test(blink_gc_plugin_test
+ python
+ ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.py
+ ${CMAKE_BINARY_DIR}/bin/clang
+ $<TARGET_FILE:lib${LIBRARYNAME}>
+ )
+endif()
« no previous file with comments | « third_party/tcmalloc/vendor/packages/rpm/rpm.spec ('k') | tools/clang/blink_gc_plugin/tests/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698