From 242f673829d40456bd1bcf3f52e10171bccd6868 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 21 Sep 2012 10:34:10 -0400 Subject: 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. --- Tests/Assembler/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 94a6325..bb4bccc 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -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 -- cgit v0.12