3 FindBadConstructsAction.cpp
4 FindBadConstructsConsumer.cpp)
7 # Clang doesn't support loadable modules on Windows. Unfortunately, building
8 # the plugin as a static library and linking clang against it doesn't work.
9 # Since clang doesn't reference any symbols in our static library, the linker
10 # strips it out completely.
11 # Instead, we rely on the fact that the SOURCES property of a target is no
12 # read-only after CMake 3.1 and use it to compile the plugin directly into
14 cmake_minimum_required(VERSION 3.1)
15 # Paths must be absolute, since we're modifying a target in another directory.
16 set(absolute_sources "")
17 foreach(source ${plugin_sources})
18 list(APPEND absolute_sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
20 set_property(TARGET clang APPEND PROPERTY SOURCES ${absolute_sources})
22 add_llvm_loadable_module(libFindBadConstructs ${plugin_sources})
23 add_dependencies(libFindBadConstructs clang)
25 cr_install(TARGETS libFindBadConstructs LIBRARY DESTINATION lib)
27 # TODO(dcheng): Rewrite the test framework so it works on Windows too.
28 cr_add_test(plugins_test
29 ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.sh
30 ${CMAKE_BINARY_DIR}/bin/clang
31 $<TARGET_FILE:libFindBadConstructs>