[compiler-rt] r252807 - [CMake] [Darwin] [Builtins] Force setting the flags we care about at the end of the compiler command line
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 13:38:36 PST 2015
Author: cbieneman
Date: Wed Nov 11 15:38:35 2015
New Revision: 252807
URL: http://llvm.org/viewvc/llvm-project?rev=252807&view=rev
Log:
[CMake] [Darwin] [Builtins] Force setting the flags we care about at the end of the compiler command line
Setting CMAKE_*_FLAGS isn't sufficient here because CMAKE_*_FLAGS_${CMAKE_BUILD_TYPE} can override the flags, and there is no way to safely clear that because it is a cached variable (<sarcasm> YAY! </sarcasm>).
Modified:
compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
Modified: compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake?rev=252807&r1=252806&r2=252807&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake Wed Nov 11 15:38:35 2015
@@ -258,9 +258,10 @@ endfunction()
macro(darwin_add_builtin_libraries)
set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes)
- set(CMAKE_C_FLAGS "-O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
- set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
- set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS})
+ set(CFLAGS "-O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
+ set(CMAKE_C_FLAGS "")
+ set(CMAKE_CXX_FLAGS "")
+ set(CMAKE_ASM_FLAGS "")
set(PROFILE_SOURCES ../profile/InstrProfiling
../profile/InstrProfilingBuffer
@@ -281,7 +282,7 @@ macro(darwin_add_builtin_libraries)
OS ${os}
ARCH ${arch}
SOURCES ${filtered_sources}
- CFLAGS -arch ${arch}
+ CFLAGS ${CFLAGS} -arch ${arch}
PARENT_TARGET builtins)
endforeach()
@@ -304,7 +305,7 @@ macro(darwin_add_builtin_libraries)
OS ${os}
ARCH ${arch}
SOURCES ${filtered_sources} ${PROFILE_SOURCES}
- CFLAGS -arch ${arch} -mkernel
+ CFLAGS ${CFLAGS} -arch ${arch} -mkernel
DEFS KERNEL_USE
PARENT_TARGET builtins)
endforeach()
@@ -358,9 +359,10 @@ macro(darwin_add_embedded_builtin_librar
set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded)
- set(CMAKE_C_FLAGS "-Oz -Wall -fomit-frame-pointer -ffreestanding")
- set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
- set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS})
+ set(CFLAGS "-Oz -Wall -fomit-frame-pointer -ffreestanding")
+ set(CMAKE_C_FLAGS "")
+ set(CMAKE_CXX_FLAGS "")
+ set(CMAKE_ASM_FLAGS "")
set(SOFT_FLOAT_FLAG -mfloat-abi=soft)
set(HARD_FLOAT_FLAG -mfloat-abi=hard)
@@ -421,7 +423,7 @@ macro(darwin_add_embedded_builtin_librar
OS macho_embedded
ARCH ${arch}
SOURCES ${${arch}_filtered_sources}
- CFLAGS -arch ${arch} ${${type}_FLAG} ${float_flag} ${CFLAGS_${arch}}
+ CFLAGS ${CFLAGS} -arch ${arch} ${${type}_FLAG} ${float_flag} ${CFLAGS_${arch}}
PARENT_TARGET builtins)
endforeach()
foreach(lib ${macho_embedded_${lib_suffix}_libs})
More information about the llvm-commits
mailing list