From 112d6760a85c3af12f9b65391052570ef06e74d1 Mon Sep 17 00:00:00 2001 From: Aaron Smith Date: Wed, 11 Apr 2018 14:56:35 +0000 Subject: [PATCH] [cmake] Remove duplicate command line options from build CMAKE_CXX_FLAGS was added twice to the command line. This causes the command line options to be doubled which works until it doesn't as not all options can be specified twice. For example, clang-cl foo.c /GS- /GS- -mllvm -small-loop-cost=1 -mllvm -small-loop-cost=1 clang (LLVM option parsing): for the -small-loop-cost option: may only occur zero or one times! llvm-svn: 329817 --- compiler-rt/cmake/Modules/AddCompilerRT.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index 2383670..a6a45f6 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -63,8 +63,8 @@ function(add_compiler_rt_object_libraries name) list(REMOVE_ITEM target_flags "-msse3") endif() - set_target_compile_flags(${libname} - ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${target_flags}) + set_target_compile_flags(${libname} ${extra_cflags_${libname}} ${target_flags}) + set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries") -- 2.7.4