mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-05 04:03:22 +03:00
Tests/Assembler: Use CMAKE_OSX_SYSROOT to generate .s file
On OS X if the user-provided flags do not include -isysroot and CMAKE_OSX_SYSROOT is defined then add the proper -isysroot flag to the C compiler invocation we use to generate the .s file.
This commit is contained in:
1 parent
a1c032b994
commit
242f673829
1 file changed
+3
@@ -12,6 +12,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND
|
||||
if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|Clang|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX))
|
||||
set(C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
separate_arguments(C_FLAGS)
|
||||
if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};")
|
||||
list(APPEND C_FLAGS ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT})
|
||||
endif()
|
||||
set(SRCS main.s)
|
||||
add_custom_command(
|
||||
OUTPUT main.s
|
||||
|
||||
Reference in new issue
Block a user