Commit 242f6738 authored by Brad King's avatar Brad King

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.
parent a1c032b9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment