Use a specified list of languages in cmake project() command.
authorDouglas Katzman <dougk@google.com>
Tue, 28 Jul 2015 14:43:53 +0000 (14:43 +0000)
committerDouglas Katzman <dougk@google.com>
Tue, 28 Jul 2015 14:43:53 +0000 (14:43 +0000)
This allows asm files and Cxx files to be compiled with different flags
rather than treating them identically. LLVM itself has no asm files
other than tests, but this setting is inherited by the compiler-rt
project (unless compiled standalone), which does have asm files.

Differential Revision: http://reviews.llvm.org/D10707

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243419 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
cmake/modules/HandleLLVMOptions.cmake

index 2901257ea8b6b4a55580b6bff0ebbf5e0ed6c826..b22efdf8cf4f38223b7b2b8505d9c0bd1d9f5851 100644 (file)
@@ -26,7 +26,7 @@ else()
   set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
 endif()
 
-project(LLVM)
+project(LLVM C CXX ASM)
 
 # The following only works with the Ninja generator in CMake >= 3.0.
 set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
index 47de43c7731b7ea516735ad14116cea6e11e88c9..bee77c14b5b4c4556509ec6234d2405b12e952c0 100644 (file)
@@ -166,6 +166,7 @@ function(add_flag_or_print_warning flag name)
     message(STATUS "Building with ${flag}")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
+    set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${flag}" PARENT_SCOPE)
   else()
     message(WARNING "${flag} is not supported.")
   endif()