CMake: Default macOS SDK version to OS version if not found
This commit is contained in:
parent
e518a5ced0
commit
ed64b35db7
@ -241,6 +241,10 @@ endif()
|
|||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
execute_process(COMMAND xcrun --show-sdk-version OUTPUT_VARIABLE MACOSX_SDK)
|
execute_process(COMMAND xcrun --show-sdk-version OUTPUT_VARIABLE MACOSX_SDK)
|
||||||
|
if(NOT MACOSX_SDK)
|
||||||
|
message(WARNING "Could not detect SDK version; defaulting to system version. Is SDKROOT set?")
|
||||||
|
set(MACOSX_SDK ${CMAKE_SYSTEM_VERSION})
|
||||||
|
endif()
|
||||||
add_definitions(-D_DARWIN_C_SOURCE)
|
add_definitions(-D_DARWIN_C_SOURCE)
|
||||||
list(APPEND OS_LIB "-framework Foundation")
|
list(APPEND OS_LIB "-framework Foundation")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user