summaryrefslogtreecommitdiff
path: root/cmake/modules/HandleLLVMOptions.cmake
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-05-02 19:34:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-05-02 19:34:44 +0000
commit6b943ff3a3f8617113ecbf611cf0f8957e4e19d2 (patch)
treefc5f365fb9035b2d0c622bbf06c9bbe8627d7279 /cmake/modules/HandleLLVMOptions.cmake
parentd0e4e96dc17a6c1c6de3340842c80f0e187ba349 (diff)
Vendor import of llvm trunk r130700:vendor/llvm/llvm-r130700
Notes
svn path=/vendor/llvm/dist/; revision=221337 svn path=/vendor/llvm/llvm-r130700/; revision=221338; tag=vendor/llvm/llvm-r130700
Diffstat (limited to 'cmake/modules/HandleLLVMOptions.cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake27
1 files changed, 25 insertions, 2 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index f62e86ae494b..0633ac9e3a5b 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -84,7 +84,7 @@ if( LLVM_ENABLE_PIC )
if( SUPPORTS_FPIC_FLAG )
message(STATUS "Building with -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
- set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
else( SUPPORTS_FPIC_FLAG )
message(WARNING "-fPIC not supported.")
endif()
@@ -102,6 +102,29 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
endif( LLVM_BUILD_32_BITS )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
+if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
+ # Only Visual Studio 2008 and 2010 officially supports /MP.
+ # Visual Studio 2005 do support it but it's experimental there.
+ set(LLVM_COMPILER_JOBS "0" CACHE STRING
+ "Number of parallel compiler jobs. 0 means use all processors. Default is 0.")
+ if( NOT LLVM_COMPILER_JOBS STREQUAL "1" )
+ if( LLVM_COMPILER_JOBS STREQUAL "0" )
+ add_llvm_definitions( /MP )
+ else()
+ if (MSVC10)
+ message(FATAL_ERROR
+ "Due to a bug in CMake only 0 and 1 is supported for "
+ "LLVM_COMPILER_JOBS when generating for Visual Studio 2010")
+ else()
+ message(STATUS "Number of parallel compiler jobs set to " ${LLVM_COMPILER_JOBS})
+ add_llvm_definitions( /MP${LLVM_COMPILER_JOBS} )
+ endif()
+ endif()
+ else()
+ message(STATUS "Parallel compilation disabled")
+ endif()
+endif()
+
if( MSVC )
include(ChooseMSVCCRT)
@@ -130,7 +153,7 @@ if( MSVC )
-wd4715 # Suppress ''function' : not all control paths return a value'
-wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'
-wd4065 # Suppress 'switch statement contains 'default' but no 'case' labels'
-
+ -wd4181 # Suppress 'qualifier applied to reference type; ignored'
-w14062 # Promote "enumerator in switch of enum is not handled" to level 1 warning.
)