From 5b6e4faacd0566dccd2604e2587d697fc228d09c Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Thu, 30 Nov 2023 13:34:24 +0000 Subject: [PATCH] fix: find macOS system libraries in leanc (#2997) Fixes #2971 --- src/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1343b654e2..faf9387129 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -439,12 +439,13 @@ include_directories(${LEAN_SOURCE_DIR}) include_directories(${CMAKE_BINARY_DIR}) # version.h etc., "private" headers include_directories(${CMAKE_BINARY_DIR}/include) # config.h etc., "public" headers +# Use CMake profile C++ flags for building Lean libraries, but do not embed in `leanc` string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) -# These are used in lean.mk (and libleanrt) and passed through by stdlib.make -# They are not embedded into `leanc` since they are build profile/machine specific string(APPEND LEANC_OPTS " ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}") + +# Do embed flag for finding system libraries in dev builds if(CMAKE_OSX_SYSROOT AND NOT LEAN_STANDALONE) - string(APPEND LEANC_OPTS " ${CMAKE_CXX_SYSROOT_FLAG}${CMAKE_OSX_SYSROOT}") + string(APPEND LEANC_EXTRA_FLAGS " ${CMAKE_CXX_SYSROOT_FLAG}${CMAKE_OSX_SYSROOT}") endif() if(${STAGE} GREATER 1)