Skip to content

Commit da115c7

Browse files
authored
cmake: Set macOS target for blst only if understood (#1028)
In some configurations (e.g. Silkworm / conan) the `CMAKE_OSX_DEPLOYMENT_TARGET` may be defined even if we don't target macOS. Pass this value to the C compiler only if it supports the deployment target flag (`-mmacos-version-min=`).
1 parent 7961b60 commit da115c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmake/blst.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ else()
99
if(CMAKE_OSX_SYSROOT)
1010
set(BLST_CC "${BLST_CC} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}")
1111
endif()
12-
if(CMAKE_OSX_DEPLOYMENT_TARGET)
12+
if(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG AND CMAKE_OSX_DEPLOYMENT_TARGET)
1313
set(BLST_CC "${BLST_CC} ${CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}")
1414
endif()
1515
if(CMAKE_C_FLAGS)

0 commit comments

Comments
 (0)