Debian Codegraph @

llvm-project/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt

raw
1 # The advisor plugin expects to not link against the Analysis, Support and Core
2 # libraries, but expects them to exist in the process loading the plugin. This
3 # doesn't work with DLLs on Windows (where a shared library can't have undefined
4 # references), so just skip this testcase on Windows.
5 if (NOT WIN32)
6 # On AIX, enable run-time linking to allow symbols from the plugins shared
7 # objects to be properly bound.
8 if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
9 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-brtl")
10 endif()
11
12 unset(LLVM_LINK_COMPONENTS)
13 add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY InlineAdvisorPlugin.cpp)
14 # Put PLUGIN next to the unit test executable.
15 set_output_directory(InlineAdvisorPlugin
16 BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../
17 LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../
18 )
19 set_target_properties(InlineAdvisorPlugin PROPERTIES FOLDER "Tests")
20
21 export_executable_symbols_for_plugins(AnalysisTests)
22 # The plugin depends on some of the output files of intrinsics_gen, so make sure
23 # it is built before the plugin.
24 add_dependencies(InlineAdvisorPlugin intrinsics_gen)
25 add_dependencies(AnalysisTests InlineAdvisorPlugin)
26 set_property(TARGET InlineAdvisorPlugin PROPERTY FOLDER "Tests/UnitTests/AnalysisTests")
27 endif()