Skip to content

Commit 0cdb5c4

Browse files
committed
s [skip ci]
1 parent fd47c46 commit 0cdb5c4

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

cmake/compilerDefinitions.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,24 @@ if(HAVE_RULES)
3737
add_definitions(-DHAVE_RULES)
3838
endif()
3939

40-
if(USE_INT128)
40+
# Visual Studio has no native support
41+
if(USE_INT128 AND NOT MSVC)
4142
add_definitions(-DHAVE_INT128)
4243
endif()
4344

4445
if(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()
4950
endif()
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+
5158
if(ENABLE_CHECK_INTERNAL)
5259
add_definitions(-DCHECK_INTERNAL)
5360
endif()

cmake/cxx11.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
macro(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()

cmake/options.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,19 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j"
9292
if(DISALLOW_THREAD_EXECUTOR AND WIN32)
9393
message(FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available")
9494
endif()
95+
9596
set(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+
97102
set(USE_BOOST "Auto" CACHE STRING "Usage of Boost")
98103
set_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")
105106
endif()
107+
106108
option(USE_LIBCXX "Use libc++ instead of libstdc++" OFF)
107109

108110
option(DISABLE_CRTDBG_MAP_ALLOC "Disable usage of Visual Studio C++ memory leak detection in Debug build" OFF)

cmake/printInfo.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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}")
9796
endif()
9897
message(STATUS)
9998
message(STATUS "USE_LIBCXX = ${USE_LIBCXX}")

0 commit comments

Comments
 (0)