[compiler-rt] r312688 - [cmake] Work around more -Wunused-driver-argument warnings

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 18:36:47 PDT 2017


Author: vedantk
Date: Wed Sep  6 18:36:47 2017
New Revision: 312688

URL: http://llvm.org/viewvc/llvm-project?rev=312688&view=rev
Log:
[cmake] Work around more -Wunused-driver-argument warnings

add_compiler_rt_object_libraries should strip out the -msse3 option on
non-macOS Apple platforms.

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=312688&r1=312687&r2=312688&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Wed Sep  6 18:36:47 2017
@@ -56,8 +56,15 @@ function(add_compiler_rt_object_librarie
 
   foreach(libname ${libnames})
     add_library(${libname} OBJECT ${LIB_SOURCES})
+
+    # Strip out -msse3 if this isn't macOS.
+    set(target_flags ${LIB_CFLAGS})
+    if(APPLE AND NOT "${libname}" MATCHES ".*\.osx.*")
+      list(REMOVE_ITEM target_flags "-msse3")
+    endif()
+
     set_target_compile_flags(${libname}
-      ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${LIB_CFLAGS})
+      ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${target_flags})
     set_property(TARGET ${libname} APPEND PROPERTY
       COMPILE_DEFINITIONS ${LIB_DEFS})
     set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries")




More information about the llvm-commits mailing list