Remove linux_chromium_gn_dbg from the chromium CQ.
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / CMakeLists.txt
blobc7fe76926948879c37ce414cd8c686450454e984
1 set(LIBRARYNAME BlinkGCPlugin)
3 set(plugin_sources
4   BlinkGCPlugin.cpp
5   CheckFieldsVisitor.cpp
6   CheckFinalizerVisitor.cpp
7   CheckGCRootsVisitor.cpp
8   CheckTraceVisitor.cpp
9   CollectVisitor.cpp
10   Config.cpp
11   Edge.cpp
12   RecordInfo.cpp)
14 if(WIN32)
15   # Clang doesn't support loadable modules on Windows. Unfortunately, building
16   # the plugin as a static library and linking clang against it doesn't work.
17   # Since clang doesn't reference any symbols in our static library, the linker
18   # strips it out completely.
19   # Instead, we rely on the fact that the SOURCES property of a target is no
20   # read-only after CMake 3.1 and use it to compile the plugin directly into
21   # clang...
22   cmake_minimum_required(VERSION 3.1)
23   # Paths must be absolute, since we're modifying a target in another directory.
24   set(absolute_sources "")
25   foreach(source ${plugin_sources})
26     list(APPEND absolute_sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
27   endforeach()
28   set_property(TARGET clang APPEND PROPERTY SOURCES ${absolute_sources})
30   cr_add_test(blink_gc_plugin_test
31     python
32     ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.py
33     ${CMAKE_BINARY_DIR}/bin/clang
34     )
35 else()
36   add_llvm_loadable_module("lib${LIBRARYNAME}" ${plugin_sources})
37   add_dependencies("lib${LIBRARYNAME}" clang)
39   cr_install(TARGETS "lib${LIBRARYNAME}" LIBRARY DESTINATION lib)
41   cr_add_test(blink_gc_plugin_test
42     python
43     ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.py
44     ${CMAKE_BINARY_DIR}/bin/clang
45     $<TARGET_FILE:lib${LIBRARYNAME}>
46     )
47 endif()