Skip to content

Commit 9dd59bc

Browse files
authored
CMake builds are fixed to actually support version 3.8
1 parent e280e70 commit 9dd59bc

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

CMakeLists.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,19 @@ if(BOOST_JSON_IS_ROOT)
5454
unset(CMAKE_FOLDER)
5555
endif()
5656

57-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pretty_printers")
58-
find_package(BoostPrettyPrinters QUIET)
59-
if(BoostPrettyPrinters_FOUND)
60-
boost_pretty_printers_gdb_python_header(
61-
TARGET boost_json_regenerate_printers
62-
INPUT src/boost_json_gdb_printers.py
63-
OUTPUT include/boost/json/detail/gdb_printers.hpp
64-
HEADER_GUARD BOOST_JSON_DETAIL_GDB_PRINTERS_HPP
65-
NO_DISABLE_MACRO
66-
EXCLUDE_FROM_ALL)
57+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0")
58+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pretty_printers")
59+
# Note: find_package(Python3) supported in cmake-3.12 onwards
60+
find_package(BoostPrettyPrinters QUIET)
61+
if(BoostPrettyPrinters_FOUND)
62+
boost_pretty_printers_gdb_python_header(
63+
TARGET boost_json_regenerate_printers
64+
INPUT src/boost_json_gdb_printers.py
65+
OUTPUT include/boost/json/detail/gdb_printers.hpp
66+
HEADER_GUARD BOOST_JSON_DETAIL_GDB_PRINTERS_HPP
67+
NO_DISABLE_MACRO
68+
EXCLUDE_FROM_ALL)
69+
endif()
6770
endif()
6871

6972
function(boost_json_setup_properties target)

test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ target_compile_definitions(boost_json-no_exceptions PRIVATE
6161
BOOST_JSON_NO_LIB=1
6262
)
6363
target_compile_options(boost_json-no_exceptions PRIVATE
64-
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-fno-exceptions>
64+
$<$<CXX_COMPILER_ID:GNU>:-fno-exceptions>
65+
$<$<CXX_COMPILER_ID:Clang>:-fno-exceptions>
66+
$<$<CXX_COMPILER_ID:AppleClang>:-fno-exceptions>
6567
$<$<CXX_COMPILER_ID:MSVC>:/wd4530>
6668
$<$<CXX_COMPILER_ID:MSVC>:/wd4577>
6769
)

0 commit comments

Comments
 (0)