Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / tools / remarks-shlib / CMakeLists.txt
blobbc4bd67e2c9ec85c4fbbd6a708eee3e9ead035a4
1 # Building shared libraries requires PIC objects.
2 if(LLVM_ENABLE_PIC)
4   set(LLVM_LINK_COMPONENTS
5     Remarks
6     )
8   set(SOURCES
9     libremarks.cpp
10     )
12   if (NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB))
13     set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
14   endif()
16   add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
18   if (LLVM_INTEGRATED_CRT_ALLOC AND MSVC)
19     # Make sure we search LLVMSupport first, before the CRT libs
20     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -INCLUDE:malloc")
21   endif()
22   
23   install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
24     DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
25     COMPONENT Remarks)
27   if (APPLE)
28     set(REMARKS_VERSION ${LLVM_VERSION_MAJOR})
29     set_property(TARGET Remarks APPEND_STRING PROPERTY
30                  LINK_FLAGS
31                  " -compatibility_version 1 -current_version ${REMARKS_VERSION}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
32   endif()
34 endif()