Skip to content

Commit

Permalink
Fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed Jul 1, 2024
1 parent 6cc8dac commit 3c4d0aa
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
path = hat-trie
url = https://github.com/masterjedy/hat-trie
[submodule "Boost.DI"]
path = Boost.DI
url = https://github.com/masterjedy/di
branch = cpp14
path = Boost.DI
url = ../Boost.DI
branch = cpp14
[submodule "cpp-ipfs-http-client"]
path = cpp-ipfs-http-client
url = https://github.com/vasild/cpp-ipfs-http-client
Expand Down Expand Up @@ -162,7 +162,7 @@
url = ../gnus_upnp.git
[submodule "sqlite3"]
path = sqlite3
url = https://github.com/GeniusVentures/sqlite-amalgamation
url = ../sqlite-amalgamation
[submodule "SQLiteModernCpp"]
path = SQLiteModernCpp
url = https://github.com/GeniusVentures/sqlite_modern_cpp.git
2 changes: 1 addition & 1 deletion Boost.DI
Submodule Boost.DI updated 387 files
2 changes: 1 addition & 1 deletion SQLiteModernCpp
Submodule SQLiteModernCpp updated 1 files
+17 −14 CMakeLists.txt
2 changes: 1 addition & 1 deletion build/Android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ endif()

set(OPENSSL_VARIANT "$<$<CONFIG:Debug>:--debug>")

set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/openssl/")
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/openssl/build/Android/${ANDROID_ABI}")

ExternalProject_Add(openssl
PREFIX openssl
Expand Down
16 changes: 8 additions & 8 deletions build/CommonTargets.CMake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ if(CMAKE_CROSSCOMPILING)
-DgRPC_INSTALL:BOOL=ON
-Dprotobuf_ABSL_PROVIDER:STRING=package
-Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=ON
-DRE2_BUILD_TESTING:BOOL=OFF
${_MSVC_RUNTIME_LIBRARY}
)

Expand Down Expand Up @@ -131,6 +132,7 @@ ExternalProject_Add(grpc
-DgRPC_ZLIB_PROVIDER:STRING=package
-Dprotobuf_ABSL_PROVIDER:STRING=package
-Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=ON
-DRE2_BUILD_TESTING:BOOL=OFF
-DZLIB_ROOT:PATH=${ZLIB_ROOT}
-DZLIB_USE_STATIC_LIBS:BOOL=ON
-DgRPC_SSL_PROVIDER:STRING=package
Expand Down Expand Up @@ -246,7 +248,10 @@ ExternalProject_Add(Boost.DI
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DBOOST_DI_OPT_BUILD_TESTS:BOOL=OFF
-DBOOST_DI_OPT_BUILD_EXAMPLES:BOOL=OFF
-DBOOST_DI_OPT_INSTALL:BOOL=ON
${_BOOST_CACHE_ARGS}
${_CMAKE_COMMON_CACHE_ARGS}
DEPENDS Boost
)
set(_FINDPACKAGE_BOOST_DI_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/Boost.DI/lib/cmake/Boost.DI")
set(_FINDPACKAGE_BOOST_DI_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Boost.DI/include")
Expand Down Expand Up @@ -326,6 +331,7 @@ ExternalProject_Add(SQLiteModernCpp
-DHUNTER_ENABLED:BOOL=OFF
-Dsqlite3_DIR:PATH=${_FINDPACKAGE_SQLITE3_CONFIG_DIR}
-DBUILD_TESTING:BOOL=OFF
-DENABLE_INSTALL:BOOL=ON
${_CMAKE_COMMON_CACHE_ARGS}
DEPENDS sqlite3
)
Expand All @@ -351,10 +357,8 @@ ExternalProject_Add(libp2p
-Dfmt_DIR:PATH=${_FINDPACKAGE_FMT_CONFIG_DIR}
-DHUNTER_ENABLED:BOOL=OFF
-DProtobuf_DIR:PATH=${Protobuf_DIR}
-DProtobuf_INCLUDE_DIR:PATH=${Protobuf_INCLUDE_DIR}
-DProtobuf_PROTOC_EXECUTABLE:FILEPATH=${PROTOC_EXECUTABLE}
-Dsoralog_DIR:PATH=${_FINDPACKAGE_SORALOG_CONFIG_DIR}
-Dspdlog_DIR:PATH=${_FINDPACKAGE_SPDLOG_CONFIG_DIR}
-Dsqlite3_DIR:PATH=${_FINDPACKAGE_SQLITE3_CONFIG_DIR}
-DSQLiteModernCpp_DIR:PATH=${_FINDPACKAGE_SQLITECPP_CONFIG_DIR}
-DTESTING:BOOL=OFF
Expand All @@ -364,7 +368,7 @@ ExternalProject_Add(libp2p
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${_CMAKE_COMMON_CACHE_ARGS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${Boost_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SPDLOG_INCLUDE_DIR}\ -I\ ${OPENSSL_INCLUDE_DIR}\ -I\ ${Protobuf_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_TSL_HAT_TRIE_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_BOOST_DI_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_CARES_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_FMT_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_YAMLCPP_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SORALOG_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SQLITECPP_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SQLITE3_INCLUDE_DIR}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SQLITE3_INCLUDE_DIR}
DEPENDS spdlog Boost Microsoft.GSL openssl cares ${PROTOBUF_TARGET} fmt yaml-cpp soralog tsl_hat_trie Boost.DI SQLiteModernCpp grpc
)
set(_FINDPACKAGE_libp2p_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/libp2p/lib/cmake/libp2p")
Expand Down Expand Up @@ -546,11 +550,11 @@ ExternalProject_Add(libsecp256k1
SOURCE_DIR "${THIRDPARTY_DIR}/libsecp256k1"
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DBUILD_SHARED_LIBS:BOOL=OFF
-DSECP256K1_BUILD_BENCHMARK:BOOL=OFF
-DSECP256K1_BUILD_CTIME_TESTS:BOOL=OFF
-DSECP256K1_BUILD_EXHAUSTIVE_TESTS:BOOL=OFF
-DSECP256K1_BUILD_TESTS:BOOL=OFF
-DSECP256K1_ENABLE_MODULE_RECOVERY:BOOL=ON
${_CMAKE_COMMON_CACHE_ARGS}
)

Expand Down Expand Up @@ -695,11 +699,7 @@ ExternalProject_Add(AsyncIOManager
-Dsoralog_DIR:PATH=${_FINDPACKAGE_SORALOG_CONFIG_DIR}
-Dspdlog_DIR:PATH=${_FINDPACKAGE_SPDLOG_CONFIG_DIR}
-Dsqlite3_DIR:PATH=${_FINDPACKAGE_SQLITE3_CONFIG_DIR}
-Dsqlite3_INCLUDE_DIR:PATH=${_FINDPACKAGE_SQLITE3_INCLUDE_DIR}
-Dsqlite3_LIB_DIR:PATH=${_FINDPACKAGE_SQLITE3_LIBRARY_DIR}
-DSQLiteModernCpp_DIR:PATH=${_FINDPACKAGE_SQLITECPP_CONFIG_DIR}
-DSQLiteModernCpp_INCLUDE_DIR:PATH=${_FINDPACKAGE_SQLITECPP_INCLUDE_DIR}
-DSQLiteModernCpp_LIB_DIR:PATH=${_FINDPACKAGE_SQLITECPP_LIBRARY_DIR}
-Dtsl_hat_trie_DIR:PATH=${_FINDPACKAGE_TSL_HAT_TRIE_CONFIG_DIR}
-Dutf8_range_DIR:PATH=${utf8_range_DIR}
-Dyaml-cpp_DIR:PATH=${_FINDPACKAGE_YAMLCPP_CONFIG_DIR}
Expand Down
13 changes: 11 additions & 2 deletions build/OSX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ if(POLICY CMP0042)
endif()

if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(PLATFORM MAC CACHE STRING "Toolchain platform parameter")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(_PLATFORM "MAC")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
set(_PLATFORM "MAC_ARM64")
endif()

set(PLATFORM _PLATFORM CACHE STRING "Toolchain platform parameter")
set(DEPLOYMENT_TARGET "12.1" CACHE STRING "Minimum OSX version")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../apple.toolchain.cmake" CACHE STRING "Toolchain file")
endif()

Expand All @@ -24,6 +31,7 @@ include(../CommonCompilerOptions.CMake)
# OSX specific runtime options
set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS}
-DPLATFORM:STRING=${PLATFORM}
-DDEPLOYMENT_TARGET:STRING=${DEPLOYMENT_TARGET}
)

# Boost
Expand Down Expand Up @@ -70,11 +78,12 @@ set(_BOOST_CACHE_ARGS

# OpenSSL
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/openssl/build/${CMAKE_SYSTEM_NAME}")
set(OPENSSL_VARIANT "$<IF:$<CONFIG:Debug>,--debug,--release>")

ExternalProject_Add(openssl
PREFIX openssl
SOURCE_DIR "${THIRDPARTY_DIR}/openssl"
CONFIGURE_COMMAND <SOURCE_DIR>/Configure darwin64-x86_64-cc $<IF:$<CONFIG:Debug>,--debug,--release> -static --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} -mmacosx-version-min=12.1
CONFIGURE_COMMAND <SOURCE_DIR>/Configure darwin64-x86_64-cc ${OPENSSL_VARIANT} -static --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} -mmacosx-version-min=12.1
BUILD_COMMAND make build_libs
BUILD_IN_SOURCE FALSE
INSTALL_COMMAND make install_dev
Expand Down
2 changes: 0 additions & 2 deletions build/apple.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -866,15 +866,13 @@ if(ARCHS MATCHES "((^|;|, )(arm64|arm64e|x86_64))+")

if(ARCHS MATCHES "((^|;|, )(arm64|arm64e))+")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
add_compile_definitions(__arm64__)
else()
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
endif()
else()
set(CMAKE_C_SIZEOF_DATA_PTR 4)
set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
set(CMAKE_SYSTEM_PROCESSOR "arm")
add_compile_definitions(__arm__)
endif()

# Note that only Xcode 7+ supports the newer more specific:
Expand Down
2 changes: 2 additions & 0 deletions build/iOS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ endif()

if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(PLATFORM OS64 CACHE STRING "Toolchain platform parameter")
set(DEPLOYMENT_TARGET "16" CACHE STRING "Minimum iOS version")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../apple.toolchain.cmake" CACHE STRING "Toolchain file")
endif()

Expand All @@ -24,6 +25,7 @@ include(../CommonCompilerOptions.CMake)
# OSX specific runtime options
set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS}
-DPLATFORM:STRING=${PLATFORM}
-DDEPLOYMENT_TARGET:STRING=${DEPLOYMENT_TARGET}
)

# Boost
Expand Down
2 changes: 1 addition & 1 deletion libsecp256k1
Submodule libsecp256k1 updated 1 files
+1 −1 CMakeLists.txt
2 changes: 1 addition & 1 deletion sqlite3
Submodule sqlite3 updated 1 files
+1 −6 CMakeLists.txt

0 comments on commit 3c4d0aa

Please sign in to comment.