[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / tools / remarks-shlib / CMakeLists.txt
blobf22cedd9ead780421ea43cd6a6ad02505aba003e
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   set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
14   add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
16   if (LLVM_INTEGRATED_CRT_ALLOC AND MSVC)
17     # Make sure we search LLVMSupport first, before the CRT libs
18     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -INCLUDE:malloc")
19   endif()
20   
21   install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
22     DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
23     COMPONENT Remarks)
25   if (APPLE)
26     set(REMARKS_VERSION ${LLVM_VERSION_MAJOR})
27     set_property(TARGET Remarks APPEND_STRING PROPERTY
28                  LINK_FLAGS
29                  " -compatibility_version 1 -current_version ${REMARKS_VERSION}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
30   endif()
32 endif()