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)