diff --git a/src/installer/corehost/cli/apphost/static/CMakeLists.txt b/src/installer/corehost/cli/apphost/static/CMakeLists.txt index 85ea6ffe642dfc..2c831032573643 100644 --- a/src/installer/corehost/cli/apphost/static/CMakeLists.txt +++ b/src/installer/corehost/cli/apphost/static/CMakeLists.txt @@ -107,15 +107,6 @@ elseif(CLR_CMAKE_TARGET_LINUX) # ) # endif(CLR_CMAKE_TARGET_OSX) # - # # On OSX and *BSD, we use the libunwind that's part of the OS - # if(CLR_CMAKE_TARGET_FREEBSD) - # find_unwind_libs(UNWIND_LIBS) - # - # LIST(APPEND CORECLR_LIBRARIES - # ${UNWIND_LIBS} - # ) - # endif(CLR_CMAKE_TARGET_FREEBSD) - # # if(CLR_CMAKE_TARGET_NETBSD) # find_library(KVM kvm) # @@ -129,6 +120,15 @@ endif(CLR_CMAKE_TARGET_WIN32) set(NATIVE_LIBS_LOCATION "${NATIVE_LIBS_ARTIFACTS}") message ("Looking for native libs at location: '${NATIVE_LIBS_LOCATION}'.") +# If/when OSX and *BSD are supported, they should also use the libunwind that's part of the OS +if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) + find_unwind_libs(UNWIND_LIBS) + + LIST(APPEND CORECLR_LIBRARIES + ${UNWIND_LIBS} + ) +endif() + if(NOT CLR_CMAKE_TARGET_LINUX) set(NATIVE_LIBS # Native libs linked into singlefilehost is supported only on Linux for now. diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake index 6c7e49fc975b62..57e356f8239dfe 100644 --- a/src/libraries/Native/Unix/configure.cmake +++ b/src/libraries/Native/Unix/configure.cmake @@ -42,6 +42,12 @@ else () message(FATAL_ERROR "Unknown platform. Cannot define PAL_UNIX_NAME, used by RuntimeInformation.") endif () +if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) + # This variable can be set and used by the coreclr and installer builds. + # Libraries doesn't need it, but not using it makes the build fail. So + # just check and igore the variable. +endif() + # We compile with -Werror, so we need to make sure these code fragments compile without warnings. # Older CMake versions (3.8) do not assign the result of their tests, causing unused-value errors # which are not distinguished from the test failing. So no error for that one.