[llvm-commits] [llvm] r143728 - in /llvm/trunk: CMakeLists.txt cmake/modules/HandleLLVMOptions.cmake
Daniel Dunbar
daniel at zuster.org
Fri Nov 4 12:04:35 PDT 2011
Author: ddunbar
Date: Fri Nov 4 14:04:35 2011
New Revision: 143728
URL: http://llvm.org/viewvc/llvm-project?rev=143728&view=rev
Log:
build/cmake: Move all the user controllable options into top-level CMakeLists
for consistency.
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=143728&r1=143727&r2=143728&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Fri Nov 4 14:04:35 2011
@@ -151,6 +151,39 @@
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
endif()
+# Define an option controlling whether we should build for 32-bit on 64-bit
+# platforms, where supported.
+if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
+ # TODO: support other platforms and toolchains.
+ option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
+endif()
+
+# Define an option controlling whether or not we include the test targets in the
+# project.
+option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
+
+# Define the default arguments to use with 'lit', and an option for the user to
+# override.
+set(LIT_ARGS_DEFAULT "-sv")
+if (MSVC OR XCODE)
+ set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+endif()
+set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+
+# On Win32/Cygwin, provide an option to specify the path to the GnuWin32 tools.
+if( WIN32 AND CYGWIN )
+ set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
+endif()
+
+# On Win32 using MS tools, provide an option to set the number of parallel jobs
+# to use.
+if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
+ # Only Visual Studio 2008 and 2010 officially supports /MP. Visual Studio
+ # 2005 supports it but it is experimental.
+ set(LLVM_COMPILER_JOBS "0" CACHE STRING
+ "Number of parallel compiler jobs. 0 means use all processors. Default is 0.")
+endif()
+
# All options referred to from HandleLLVMOptions have to be specified
# BEFORE this include, otherwise options will not be correctly set on
# first cmake run
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=143728&r1=143727&r2=143728&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Fri Nov 4 14:04:35 2011
@@ -1,3 +1,7 @@
+# This CMake module is responsible for interpreting the user defined LLVM_
+# options and executing the appropriate CMake commands to realize the users'
+# selections.
+
include(AddLLVMDefinitions)
if( CMAKE_COMPILER_IS_GNUCXX )
@@ -20,13 +24,6 @@
set(RUNTIME_BUILD_MODE "${CMAKE_CFG_INTDIR}")
endif()
-set(LIT_ARGS_DEFAULT "-sv")
-if (MSVC OR XCODE)
- set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
-endif()
-set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
- CACHE STRING "Default options for lit")
-
if( LLVM_ENABLE_ASSERTIONS )
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
if( NOT MSVC )
@@ -52,9 +49,6 @@
else(CYGWIN)
set(LLVM_ON_WIN32 1)
set(LLVM_ON_UNIX 0)
-
- # This is effective only on Win32 hosts to use gnuwin32 tools.
- set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
endif(CYGWIN)
set(LTDL_SHLIB_EXT ".dll")
set(EXEEXT ".exe")
@@ -99,7 +93,6 @@
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
# TODO: support other platforms and toolchains.
- option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
if( LLVM_BUILD_32_BITS )
message(STATUS "Building 32 bits executables and libraries.")
add_llvm_definitions( -m32 )
@@ -189,5 +182,3 @@
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
add_llvm_definitions( -D__STDC_FORMAT_MACROS )
add_llvm_definitions( -D__STDC_LIMIT_MACROS )
-
-option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
More information about the llvm-commits
mailing list