mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 18:15:50 +00:00
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d). This change updates the CMake files and definitions therein, plus a handful of related modifications. Specifically, the compiler files are renamed from `RippleXXX.cmake` or `RippledXXX.cmake` to `XrplXXX.cmake`, and any references to `ripple` and `rippled` (with or without capital letters) are renamed to `xrpl` and `xrpld`, respectively. The name of the binary, currently `rippled`, remains unchanged and will be updated in a separate PR. This change is purely cosmetic and does not affect the functioning of the binary.
71 lines
2.5 KiB
CMake
71 lines
2.5 KiB
CMake
#[===================================================================[
|
|
convenience variables and sanity checks
|
|
#]===================================================================]
|
|
|
|
get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
|
|
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
|
if (NOT is_multiconfig)
|
|
if (NOT CMAKE_BUILD_TYPE)
|
|
message (STATUS "Build type not specified - defaulting to Release")
|
|
set (CMAKE_BUILD_TYPE Release CACHE STRING "build type" FORCE)
|
|
elseif (NOT (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL Release))
|
|
# for simplicity, these are the only two config types we care about. Limiting
|
|
# the build types simplifies dealing with external project builds especially
|
|
message (FATAL_ERROR " *** Only Debug or Release build types are currently supported ***")
|
|
endif ()
|
|
endif ()
|
|
|
|
get_directory_property(has_parent PARENT_DIRECTORY)
|
|
if (has_parent)
|
|
set (is_root_project OFF)
|
|
else ()
|
|
set (is_root_project ON)
|
|
endif ()
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") # both Clang and AppleClang
|
|
set (is_clang TRUE)
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
|
|
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
|
message (FATAL_ERROR "This project requires clang 8 or later")
|
|
endif ()
|
|
# TODO min AppleClang version check ?
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
set (is_gcc TRUE)
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
|
message (FATAL_ERROR "This project requires GCC 8 or later")
|
|
endif ()
|
|
endif ()
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
set (is_linux TRUE)
|
|
else ()
|
|
set (is_linux FALSE)
|
|
endif ()
|
|
|
|
if ("$ENV{CI}" STREQUAL "true" OR "$ENV{CONTINUOUS_INTEGRATION}" STREQUAL "true")
|
|
set (is_ci TRUE)
|
|
else ()
|
|
set (is_ci FALSE)
|
|
endif ()
|
|
|
|
# check for in-source build and fail
|
|
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
|
message (FATAL_ERROR "Builds (in-source) are not allowed in "
|
|
"${CMAKE_CURRENT_SOURCE_DIR}. Please remove CMakeCache.txt and the CMakeFiles "
|
|
"directory from ${CMAKE_CURRENT_SOURCE_DIR} and try building in a separate directory.")
|
|
endif ()
|
|
|
|
if (MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
|
|
message (FATAL_ERROR "Visual Studio 32-bit build is not supported.")
|
|
endif ()
|
|
|
|
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
message (FATAL_ERROR "Xrpld requires a 64 bit target architecture.\n"
|
|
"The most likely cause of this warning is trying to build xrpld with a 32-bit OS.")
|
|
endif ()
|
|
|
|
if (APPLE AND NOT HOMEBREW)
|
|
find_program (HOMEBREW brew)
|
|
endif ()
|