Remove checks for CMake < 3.16

This commit is contained in:
Michael Legleux
2022-03-24 11:40:34 -07:00
committed by manojsdoshi
parent 375af87a86
commit bea9610440
14 changed files with 48 additions and 109 deletions

View File

@@ -998,13 +998,11 @@ message(STATUS "Reporting mode build: rippled renamed ${BIN_NAME}")
target_compile_definitions(rippled PRIVATE RIPPLED_REPORTING) target_compile_definitions(rippled PRIVATE RIPPLED_REPORTING)
endif() endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) # any files that don't play well with unity should be added here
# any files that don't play well with unity should be added here if (tests)
if (tests) set_source_files_properties(
set_source_files_properties( # these two seem to produce conflicts in beast teardown template methods
# these two seem to produce conflicts in beast teardown template methods src/test/rpc/ValidatorRPC_test.cpp
src/test/rpc/ValidatorRPC_test.cpp src/test/rpc/ShardArchiveHandler_test.cpp
src/test/rpc/ShardArchiveHandler_test.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE) endif () #tests
endif () #tests
endif ()

View File

@@ -10,13 +10,8 @@ option (tests "Build tests" ON)
option (unity "Creates a build using UNITY support in cmake. This is the default" ON) option (unity "Creates a build using UNITY support in cmake. This is the default" ON)
if (unity) if (unity)
if (CMAKE_VERSION VERSION_LESS 3.16) if (NOT is_ci)
message (WARNING "unity option only supported for with cmake 3.16+ (please upgrade)") set (CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
set (unity OFF CACHE BOOL "unity only available for cmake 3.16+" FORCE)
else ()
if (NOT is_ci)
set (CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
endif ()
endif () endif ()
endif () endif ()
if (is_gcc OR is_clang) if (is_gcc OR is_clang)

View File

@@ -1,6 +1,6 @@
option (validator_keys "Enables building of validator-keys-tool as a separate target (imported via FetchContent)" OFF) option (validator_keys "Enables building of validator-keys-tool as a separate target (imported via FetchContent)" OFF)
if (validator_keys AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11) if (validator_keys)
git_branch (current_branch) git_branch (current_branch)
# default to tracking VK develop branch unless we are on master/release # default to tracking VK develop branch unless we are on master/release
if (NOT (current_branch STREQUAL "master" OR current_branch STREQUAL "release")) if (NOT (current_branch STREQUAL "master" OR current_branch STREQUAL "release"))
@@ -20,5 +20,3 @@ if (validator_keys AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
endif () endif ()
add_subdirectory (${validator_keys_src_SOURCE_DIR} ${CMAKE_BINARY_DIR}/validator-keys) add_subdirectory (${validator_keys_src_SOURCE_DIR} ${CMAKE_BINARY_DIR}/validator-keys)
endif () endif ()

View File

@@ -125,7 +125,7 @@ if (local_libarchive)
--build . --build .
--config $<CONFIG> --config $<CONFIG>
--target archive_static --target archive_static
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -43,7 +43,7 @@ else()
--build . --build .
--config $<CONFIG> --config $<CONFIG>
--target lz4_static --target lz4_static
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -8,40 +8,24 @@
if (is_root_project) # NuDB not needed in the case of xrpl_core inclusion build if (is_root_project) # NuDB not needed in the case of xrpl_core inclusion build
add_library (nudb INTERFACE) add_library (nudb INTERFACE)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.11) FetchContent_Declare(
FetchContent_Declare( nudb_src
nudb_src GIT_REPOSITORY https://github.com/CPPAlliance/NuDB.git
GIT_REPOSITORY https://github.com/CPPAlliance/NuDB.git GIT_TAG 2.0.5
GIT_TAG 2.0.5 )
) FetchContent_GetProperties(nudb_src)
FetchContent_GetProperties(nudb_src) if(NOT nudb_src_POPULATED)
if(NOT nudb_src_POPULATED) message (STATUS "Pausing to download NuDB...")
message (STATUS "Pausing to download NuDB...") FetchContent_Populate(nudb_src)
FetchContent_Populate(nudb_src) endif()
endif()
else ()
ExternalProject_Add (nudb_src
PREFIX ${nih_cache_path}
GIT_REPOSITORY https://github.com/CPPAlliance/NuDB.git
GIT_TAG 2.0.5
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property (nudb_src SOURCE_DIR)
set (nudb_src_SOURCE_DIR "${SOURCE_DIR}")
file (MAKE_DIRECTORY ${nudb_src_SOURCE_DIR}/include)
add_dependencies (nudb nudb_src)
endif ()
file(TO_CMAKE_PATH "${nudb_src_SOURCE_DIR}" nudb_src_SOURCE_DIR)
# specify as system includes so as to avoid warnings
target_include_directories (nudb SYSTEM INTERFACE ${nudb_src_SOURCE_DIR}/include)
target_link_libraries (nudb
INTERFACE
Boost::thread
Boost::system)
add_library (NIH::nudb ALIAS nudb)
target_link_libraries (ripple_libs INTERFACE NIH::nudb)
endif () endif ()
file(TO_CMAKE_PATH "${nudb_src_SOURCE_DIR}" nudb_src_SOURCE_DIR)
# specify as system includes so as to avoid warnings
target_include_directories (nudb SYSTEM INTERFACE ${nudb_src_SOURCE_DIR}/include)
target_link_libraries (nudb
INTERFACE
Boost::thread
Boost::system)
add_library (NIH::nudb ALIAS nudb)
target_link_libraries (ripple_libs INTERFACE NIH::nudb)

View File

@@ -65,7 +65,7 @@ if (local_protobuf OR NOT (Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE AND pro
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
TEST_COMMAND "" TEST_COMMAND ""
INSTALL_COMMAND INSTALL_COMMAND
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install ${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install

View File

@@ -136,7 +136,7 @@ if (local_rocksdb)
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -42,7 +42,7 @@ else()
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -113,7 +113,7 @@ else()
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -56,7 +56,7 @@ else()
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -9,41 +9,10 @@
find_package (date QUIET) find_package (date QUIET)
if (NOT TARGET date::date) if (NOT TARGET date::date)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) FetchContent_Declare(
FetchContent_Declare( hh_date_src
hh_date_src GIT_REPOSITORY https://github.com/HowardHinnant/date.git
GIT_REPOSITORY https://github.com/HowardHinnant/date.git GIT_TAG fc4cf092f9674f2670fb9177edcdee870399b829
GIT_TAG fc4cf092f9674f2670fb9177edcdee870399b829 )
) FetchContent_MakeAvailable(hh_date_src)
FetchContent_MakeAvailable(hh_date_src)
else ()
ExternalProject_Add (hh_date_src
PREFIX ${nih_cache_path}
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
GIT_TAG fc4cf092f9674f2670fb9177edcdee870399b829
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property (hh_date_src SOURCE_DIR)
set (hh_date_src_SOURCE_DIR "${SOURCE_DIR}")
file (MAKE_DIRECTORY ${hh_date_src_SOURCE_DIR}/include)
add_library (date_interface INTERFACE)
add_library (date::date ALIAS date_interface)
add_dependencies (date_interface hh_date_src)
file (TO_CMAKE_PATH "${hh_date_src_SOURCE_DIR}" hh_date_src_SOURCE_DIR)
target_include_directories (date_interface
SYSTEM INTERFACE
$<BUILD_INTERFACE:${hh_date_src_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
install (
FILES
${hh_date_src_SOURCE_DIR}/include/date/date.h
DESTINATION include/date)
install (TARGETS date_interface
EXPORT RippleExports
INCLUDES DESTINATION include)
endif ()
endif () endif ()

View File

@@ -112,7 +112,7 @@ else ()
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
TEST_COMMAND "" TEST_COMMAND ""
INSTALL_COMMAND INSTALL_COMMAND
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install ${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
@@ -169,7 +169,7 @@ else ()
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
TEST_COMMAND "" TEST_COMMAND ""
INSTALL_COMMAND INSTALL_COMMAND
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install ${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
@@ -237,7 +237,7 @@ else ()
${CMAKE_COMMAND} ${CMAKE_COMMAND}
--build . --build .
--config $<CONFIG> --config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}> --parallel ${ep_procs}
$<$<BOOL:${is_multiconfig}>: $<$<BOOL:${is_multiconfig}>:
COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_COMMAND} -E copy

View File

@@ -25,12 +25,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps")
include (CheckCXXCompilerFlag) include (CheckCXXCompilerFlag)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.11) include (FetchContent)
include (FetchContent)
endif ()
if (MSVC AND CMAKE_VERSION VERSION_LESS 3.12)
message (FATAL_ERROR "MSVC requires cmake 3.12 or greater for proper boost support")
endif ()
include (ExternalProject) include (ExternalProject)
include (CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP include (CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP
include (ProcessorCount) include (ProcessorCount)