Home | History | Annotate | Download | only in plugins
      1 set(plugin_sources
      2   ChromeClassTester.cpp
      3   FindBadConstructsAction.cpp
      4   FindBadConstructsConsumer.cpp
      5   CheckIPCVisitor.cpp
      6   Util.cpp
      7 )
      8 
      9 if(WIN32)
     10   # Clang doesn't support loadable modules on Windows. Unfortunately, building
     11   # the plugin as a static library and linking clang against it doesn't work.
     12   # Since clang doesn't reference any symbols in our static library, the linker
     13   # strips it out completely.
     14   # Instead, we rely on the fact that the SOURCES property of a target is no
     15   # read-only after CMake 3.1 and use it to compile the plugin directly into
     16   # clang...
     17   cmake_minimum_required(VERSION 3.1)
     18   # Paths must be absolute, since we're modifying a target in another directory.
     19   set(absolute_sources "")
     20   foreach(source ${plugin_sources})
     21     list(APPEND absolute_sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
     22   endforeach()
     23   set_property(TARGET clang APPEND PROPERTY SOURCES ${absolute_sources})
     24 
     25   cr_add_test(plugins_test
     26     python tests/test.py
     27     ${CMAKE_BINARY_DIR}/bin/clang
     28   )
     29 else()
     30   add_llvm_loadable_module(libFindBadConstructs ${plugin_sources})
     31   add_dependencies(libFindBadConstructs clang)
     32 
     33   cr_install(TARGETS libFindBadConstructs LIBRARY DESTINATION lib)
     34 
     35   cr_add_test(plugins_test
     36     python tests/test.py
     37     ${CMAKE_BINARY_DIR}/bin/clang
     38     $<TARGET_FILE:libFindBadConstructs>
     39   )
     40 endif()
     41