From 0edb4435d479cf94bf857e8fa3261d49d4775f25 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 21 Jun 2022 18:57:36 -0300 Subject: [PATCH] Cmake cleanup: remove unneeded =1 from definitions We only check for definedness, not truth, in the code so make the cmake definitions agree with that. This also avoids warnings when building on macos (because swift only allowed defined/undefined but not values) --- CMakeLists.txt | 6 +++--- cmake/shadow.cmake | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac2067e0d..a5309126a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,7 +191,7 @@ if(XSAN) endif() if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]") - add_definitions(-DLOKINET_DEBUG=1) + add_definitions(-DLOKINET_DEBUG) endif() @@ -224,7 +224,7 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) if(TESTNET) - add_definitions(-DTESTNET=1) + add_definitions(-DTESTNET) # 5 times slower than realtime # add_definitions(-DTESTNET_SPEED=5) endif() @@ -288,7 +288,7 @@ if(ANDROID) endif() if(WITH_HIVE) - add_definitions(-DLOKINET_HIVE=1) + add_definitions(-DLOKINET_HIVE) endif() add_subdirectory(crypto) diff --git a/cmake/shadow.cmake b/cmake/shadow.cmake index deed362b1..6eac1a28e 100644 --- a/cmake/shadow.cmake +++ b/cmake/shadow.cmake @@ -9,10 +9,13 @@ else() message(FATAL_ERROR "SHADOW_ROOT path does not exist: '${SHADOW_ROOT}'") endif(EXISTS "${SHADOW_ROOT}") +if(NOT TESTNET) + message(FATAL_ERROR "shadow testing framework requires a testnet build") +endif() + set(CMAKE_MODULE_PATH "${SHADOW_ROOT}/share/cmake/Modules") include_directories(${CMAKE_MODULE_PATH}) include(ShadowTools) add_compile_options(-fno-inline -fno-strict-aliasing ) -add_definitions(-DTESTNET=1) add_definitions(-DLOKINET_SHADOW) include_directories(${SHADOW_ROOT}/include)