Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2007-06-09 14:34:59


Author: dgregor
Date: 2007-06-09 14:34:58 EDT (Sat, 09 Jun 2007)
New Revision: 4511
URL: http://svn.boost.org/trac/boost/changeset/4511

Log:
Include STATIC_RUNTIME and DYNAMIC_RUNTIME variants on Windows. Still not perfect yet, though...

Text files modified:
   sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt | 15 ++++++++++++++-
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake | 5 +++++
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake | 8 +++++++-
   3 files changed, 26 insertions(+), 2 deletions(-)

Modified: sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt 2007-06-09 14:34:58 EDT (Sat, 09 Jun 2007)
@@ -58,10 +58,23 @@
 option(BUILD_SINGLE_THREADED "Whether to build single-threaded libraries" ON)
 option(BUILD_MULTI_THREADED "Whether to build multi-threaded libraries" ON)
 
+# For now, we only actually support static/dynamic run-time variants for
+# Visual C++. Provide both options for Visual C++ users, but just fix
+# the values of the variables for all other platforms.
+if(MSVC)
+ option(BUILD_STATIC_RUNTIME "Whether to build libraries linking against the static runtime" ON)
+ option(BUILD_DYNAMIC_RUNTIME "Whether to build libraries linking against the dynamic runtime" ON)
+else(MSVC)
+ set(BUILD_STATIC_RUNTIME OFF)
+ set(BUILD_DYNAMIC_RUNTIME ON)
+endif(MSVC)
+
 # The default set of library variants that we will be building
 boost_add_default_variant(STATIC SHARED)
 boost_add_default_variant(DEBUG RELEASE)
 boost_add_default_variant(SINGLE_THREADED MULTI_THREADED)
+boost_add_default_variant(STATIC_RUNTIME DYNAMIC_RUNTIME)
+
 
 # Extra features used by some libraries
 boost_add_extra_variant(PYTHON_NODEBUG PYTHON_DEBUG)
@@ -113,7 +126,7 @@
 # include files in boost/
 include_directories(${Boost_SOURCE_DIR})
 
-# Put the libaroes and binaroes that get built into directories at the
+# Put the libaries and binaries that get built into directories at the
 # top of the build tree rather than in hard-to-find leaf
 # directories. This simplifies manual testing and the use of the build
 # tree rather than installed Boost libraries.

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake 2007-06-09 14:34:58 EDT (Sat, 09 Jun 2007)
@@ -109,3 +109,8 @@
   set(MULTI_THREADED_LINK_LIBS pthread rt)
 endif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
 
+# Static and dynamic runtime linking options
+if(MSVC)
+ set(RUNTIME_STATIC_LINK_FLAGS "/MT")
+ set(RUNTIME_DYNAMIC_LINK_FLAGS "/MD")
+endif(MSVC)
\ No newline at end of file

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake 2007-06-09 14:34:58 EDT (Sat, 09 Jun 2007)
@@ -148,7 +148,13 @@
   # Compute the ABI tag, which depends on various kinds of options
   set(VARIANT_ABI_TAG "")
 
- # TODO: Linking statically to the runtime library
+ # Linking statically to the runtime library
+ list_contains(VARIANT_IS_STATIC_RUNTIME STATIC_RUNTIME ${ARGN})
+ if (VARIANT_IS_STATIC_RUNTIME)
+ set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-staticrt")
+ set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}s")
+ endif (VARIANT_IS_STATIC_RUNTIME)
+
   # TODO: Using debug versions of the standard/runtime support libs
 
   # Add -pydebug for debug builds of Python


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk