diff options
author | Tomas Weinfurt <tweinfurt@yahoo.com> | 2018-06-19 13:54:41 -0700 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2018-06-19 22:54:41 +0200 |
commit | 4c51b2dbbdd9bdf23552a9d26ad08a78ce1523cc (patch) | |
tree | 16ff9b01f3ca0aaa8755d324deaf91e6dff6d09b /src/pal/src/CMakeLists.txt | |
parent | d3905518d08ca174ae631aebfe16314b885aa61a (diff) | |
download | coreclr-4c51b2dbbdd9bdf23552a9d26ad08a78ce1523cc.tar.gz coreclr-4c51b2dbbdd9bdf23552a9d26ad08a78ce1523cc.tar.bz2 coreclr-4c51b2dbbdd9bdf23552a9d26ad08a78ce1523cc.zip |
fixes for sos on FreeBSD (#18479)
* fixes for sos on FreeBSD
* refactore unwind detection to common block for BSD and Linux
* missing newline
* do not do libunwind detection for OSX
Diffstat (limited to 'src/pal/src/CMakeLists.txt')
-rw-r--r-- | src/pal/src/CMakeLists.txt | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt index 130e06ed4b..a3cc603e18 100644 --- a/src/pal/src/CMakeLists.txt +++ b/src/pal/src/CMakeLists.txt @@ -16,8 +16,37 @@ if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) include_directories(${CMAKE_CURRENT_BINARY_DIR}/libunwind/include/tdep) add_subdirectory(libunwind) -endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) +elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(PAL_CMAKE_PLATFORM_ARCH_ARM) + find_library(UNWIND_ARCH NAMES unwind-arm) + endif() + + if(PAL_CMAKE_PLATFORM_ARCH_ARM64) + find_library(UNWIND_ARCH NAMES unwind-aarch64) + endif() + + if(PAL_CMAKE_PLATFORM_ARCH_AMD64) + find_library(UNWIND_ARCH NAMES unwind-x86_64) + endif() + + if(NOT UNWIND_ARCH STREQUAL UNWIND_ARCH-NOTFOUND) + set(UNWIND_LIBS ${UNWIND_ARCH}) + endif() + find_library(UNWIND_GENERIC NAMES unwind-generic) + + if(NOT UNWIND_GENERIC STREQUAL UNWIND_GENERIC-NOTFOUND) + set(UNWIND_LIBS ${UNWIND_LIBS} ${UNWIND_GENERIC}) + endif() + + find_library(UNWIND NAMES unwind) + + if(UNWIND STREQUAL UNWIND-NOTFOUND) + message(FATAL_ERROR "Cannot find libunwind. Try installing libunwind8-dev or libunwind-devel.") + endif() + + set(UNWIND_LIBS ${UNWIND_LIBS} ${UNWIND}) +endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) include(configure.cmake) project(coreclrpal) @@ -275,14 +304,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) endif(CMAKE_SYSTEM_NAME STREQUAL Darwin) if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) - if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) - find_library(UNWIND unwind) - endif() find_library(INTL intl) target_link_libraries(coreclrpal pthread rt - ${UNWIND} + ${UNWIND_LIBS} ${INTL} ) endif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) @@ -342,36 +368,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux) endif(NOT INTL STREQUAL INTL-NOTFOUND) if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) - if(PAL_CMAKE_PLATFORM_ARCH_ARM) - find_library(UNWIND_ARCH NAMES unwind-arm) - endif() - - if(PAL_CMAKE_PLATFORM_ARCH_ARM64) - find_library(UNWIND_ARCH NAMES unwind-aarch64) - endif() - - if(PAL_CMAKE_PLATFORM_ARCH_AMD64) - find_library(UNWIND_ARCH NAMES unwind-x86_64) - endif() - - if(NOT UNWIND_ARCH STREQUAL UNWIND_ARCH-NOTFOUND) - target_link_libraries(coreclrpal ${UNWIND_ARCH}) - endif() - - find_library(UNWIND_GENERIC NAMES unwind-generic) - - if(NOT UNWIND_GENERIC STREQUAL UNWIND_GENERIC-NOTFOUND) - target_link_libraries(coreclrpal ${UNWIND_GENERIC}) - endif() - - find_library(UNWIND NAMES unwind) - - if(UNWIND STREQUAL UNWIND-NOTFOUND) - message(FATAL_ERROR "Cannot find libunwind. Try installing libunwind8-dev or libunwind-devel.") - endif() - - target_link_libraries(coreclrpal ${UNWIND}) - + target_link_libraries(coreclrpal ${UNWIND_LIBS}) endif(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) endif(CMAKE_SYSTEM_NAME STREQUAL Linux) |