File tree Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,24 @@ if(HAVE_RULES)
3737 add_definitions (-DHAVE_RULES)
3838endif ()
3939
40- if (USE_INT128)
40+ # Visual Studio has no native support
41+ if (USE_INT128 AND NOT MSVC )
4142 add_definitions (-DHAVE_INT128)
4243endif ()
4344
4445if (Boost_FOUND)
4546 add_definitions (-DHAVE_BOOST)
46- if (USE_INT128 AND USE_BOOST_INT128 )
47+ if (USE_INT128 STREQUAL "Boost" )
4748 add_definitions (-DHAVE_BOOST_INT128)
4849 endif ()
4950endif ()
5051
52+ # Visual Studio falls back to Boost since it has no native 128-bit integer support
53+ if (USE_INT128 STREQUAL "Auto" AND Boost_FOUND)
54+ add_definitions (-DHAVE_INT128)
55+ add_definitions (-DHAVE_BOOST_INT128)
56+ endif ()
57+
5158if (ENABLE_CHECK_INTERNAL)
5259 add_definitions (-DCHECK_INTERNAL)
5360endif ()
Original file line number Diff line number Diff line change 11macro (use_cxx11)
2- if (USE_BOOST AND USE_BOOST_INT128)
2+ # enable unconditionally for Visual Studio since it is the lowest possible standard to select
3+ if (MSVC OR (USE_BOOST AND USE_INT128 STREQUAL "Boost" ))
34 # Boost.Math requires C++14
45 set (CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to use" )
56 else ()
Original file line number Diff line number Diff line change @@ -92,17 +92,19 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j"
9292if (DISALLOW_THREAD_EXECUTOR AND WIN32 )
9393 message (FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available" )
9494endif ()
95+
9596set (USE_INT128 "Off" CACHE STRING "Usage of 128-bit integer type" ) # TODO: default to Auto when working
96- set_property (CACHE USE_INT128 PROPERTY STRINGS Auto Off On )
97+ set_property (CACHE USE_INT128 PROPERTY STRINGS Auto Off Native Boost)
98+ if (USE_INT128 STREQUAL "Native" AND MSVC )
99+ message (FATAL_ERROR "Visual Studio has no native 128-bit integer support" )
100+ endif ()
101+
97102set (USE_BOOST "Auto" CACHE STRING "Usage of Boost" )
98103set_property (CACHE USE_BOOST PROPERTY STRINGS Auto Off On )
99- set (USE_BOOST_INT128 "Off" CACHE STRING "Usage of Boost.Multiprecision 128-bit integer for Mathlib" ) # TODO: default to Auto when working
100- set_property (CACHE USE_BOOST_INT128 PROPERTY STRINGS Auto Off On )
101- if (USE_INT128)
102- if (NOT USE_BOOST AND USE_BOOST_INT128)
103- message (FATAL_ERROR "USE_BOOST_INT128 requires USE_BOOST to be enabled" )
104- endif ()
104+ if (USE_INT128 STREQUAL "Boost" AND NOT USE_BOOST)
105+ message (FATAL_ERROR "USE_INT128=Boost requires USE_BOOST to be enabled" )
105106endif ()
107+
106108option (USE_LIBCXX "Use libc++ instead of libstdc++" OFF )
107109
108110option (DISABLE_CRTDBG_MAP_ALLOC "Disable usage of Visual Studio C++ memory leak detection in Debug build" OFF )
Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ if(USE_BOOST)
9393 message (STATUS "Boost_FOUND = ${Boost_FOUND} " )
9494 message (STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING} " )
9595 message (STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS} " )
96- message (STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128} " )
9796endif ()
9897message (STATUS )
9998message (STATUS "USE_LIBCXX = ${USE_LIBCXX} " )
You can’t perform that action at this time.
0 commit comments