Tests/FortranC: Handle empty CMAKE_OSX_SYSROOT

The compiler inside Xcode requires an explicit `-isysroot`.
Replace it with the `/usr/bin/cc` wrapper.
This commit is contained in:
Brad King 2024-11-06 13:44:23 -05:00
parent 87a9e50995
commit 1faf60cffc

View File

@ -5,6 +5,9 @@ set(bld "@CMAKE_CURRENT_BINARY_DIR@/FortranC/Flags")
# flags, remove them, and invoke the real compiler.
set(ID "CC")
set(COMMAND "@CMAKE_C_COMPILER@")
if("x${COMMAND}" MATCHES "xctoolchain(/usr/bin/cc)$")
set(COMMAND "${CMAKE_MATCH_1}")
endif()
configure_file("${src}/test_opt.sh.in" "${bld}/cc.sh" @ONLY)
set(ID "FC")
set(COMMAND "@CMAKE_Fortran_COMPILER@")