diff --git a/build/Android/CMakeLists.txt b/build/Android/CMakeLists.txt index 74115c37..6ffa9e81 100644 --- a/build/Android/CMakeLists.txt +++ b/build/Android/CMakeLists.txt @@ -1,12 +1,10 @@ cmake_minimum_required(VERSION 3.15) -# -------------------------------------------------------- # Set cross compiling settings set(CMAKE_SYSTEM_NAME Android) set(CMAKE_SYSTEM_VERSION 28) # API level set(ANDROID_NATIVE_API_LEVEL 28) -# -------------------------------------------------------- # Check Android NDK version if(NOT CMAKE_ANDROID_NDK) message(FATAL_ERROR "Cannot find Android NDK, make sure you pass -DCMAKE_ANDROID_NDK=[path_to_NDK]") @@ -23,7 +21,6 @@ if(NOT CMAKE_ANDROID_NDK_VERSION EQUAL 25) message(FATAL_ERROR "Android NDK LTS Version (r25b) stable long term support version required") endif() -# -------------------------------------------------------- # Check required input args if(NOT ANDROID_ABI) message(FATAL_ERROR "Cannot find ANDROID_ABI, make sure you pass -DANDROID_ABI=[armeabi-v7a | arm64-v8a | x86 | x86_64]") @@ -35,11 +32,9 @@ if(NOT ANDROID_TOOLCHAIN) message(FATAL_ERROR "Cannot find ANDROID_TOOLCHAIN, make sure you pass -DANDROID_TOOLCHAIN=[e.g clang]") endif() -# -------------------------------------------------------- # Config param for android set(CMAKE_ANDROID_STL_TYPE c++_static) -# -------------------------------------------------------- # Set toolchain file set(CMAKE_TOOLCHAIN_FILE "${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake") @@ -49,39 +44,29 @@ endif() set(Boost_COMPILER "clang") - -# -------------------------------------------------------- # Project project(SuperGenius C CXX) -# -------------------------------------------------------- # include common compiler options include(../CommonCompilerOptions.CMake) -# -------------------------------------------------------- # Turn off examples set(BUILD_EXAMPLES OFF) -# -------------------------------------------------------- # Set custom subfolder for ABI set(ABI_SUBFOLDER_NAME "/${ANDROID_ABI}") -# -------------------------------------------------------- # Set host system protoc executable path - set(PROTOC_EXECUTABLE "${_THIRDPARTY_BUILD_DIR}/protobuf_host/bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") -# -------------------------------------------------------- # Allow multiple definitions set(FORCE_MULTILE OFF) -# -------------------------------------------------------- # Set extra compiler flags set(EXTRA_CXX_FLAGS -Wno-error) set(TESTING OFF) -# -------------------------------------------------------- # Include common build parameters include(../CommonBuildParameters.cmake) diff --git a/build/CommonBuildParameters.cmake b/build/CommonBuildParameters.cmake index 4f7b156a..640fc0b9 100644 --- a/build/CommonBuildParameters.cmake +++ b/build/CommonBuildParameters.cmake @@ -8,8 +8,7 @@ set(BOOST_VERSION "${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_V set(BOOST_VERSION_3U "${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_PATCH_VERSION}") set(BOOST_VERSION_2U "${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}") -# -------------------------------------------------------- -# Set config of GTest +# GTest set(GTest_DIR "${_THIRDPARTY_BUILD_DIR}/GTest/lib/cmake/GTest") set(GTest_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/GTest/include") find_package(GTest CONFIG REQUIRED) @@ -25,8 +24,7 @@ if(NOT DEFINED utf8_range_DIR) set(utf8_range_DIR "${_THIRDPARTY_BUILD_DIR}/grpc/lib/cmake/utf8_range") endif() -# -------------------------------------------------------- -# Set config of protobuf project +# protobuf project if(NOT DEFINED Protobuf_DIR) set(Protobuf_DIR "${_THIRDPARTY_BUILD_DIR}/grpc/lib/cmake/protobuf") endif() @@ -56,7 +54,7 @@ if(EXISTS "${Protobuf_PROTOC_EXECUTABLE}") IMPORTED_LOCATION ${Protobuf_PROTOC_EXECUTABLE}) endif() -# protoc definition ##################################################################################### +# protoc definition get_target_property(PROTOC_LOCATION protobuf::protoc IMPORTED_LOCATION) print("PROTOC_LOCATION: ${PROTOC_LOCATION}") @@ -67,8 +65,7 @@ endif() include(${PROJECT_ROOT}/cmake/functions.cmake) -# -------------------------------------------------------- -# Set config of openssl project +# openssl project set(OPENSSL_DIR "${_THIRDPARTY_BUILD_DIR}/openssl/build/${CMAKE_SYSTEM_NAME}${ABI_SUBFOLDER_NAME}" CACHE PATH "Path to OpenSSL install folder") set(OPENSSL_USE_STATIC_LIBS ON CACHE BOOL "OpenSSL use static libs") set(OPENSSL_MSVC_STATIC_RT ON CACHE BOOL "OpenSSL use static RT") @@ -80,68 +77,58 @@ set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBRARIES}/libssl${CMAKE_STATIC_LIBRARY_SUFFIX find_package(OpenSSL REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of rocksdb +# rocksdb set(RocksDB_DIR "${_THIRDPARTY_BUILD_DIR}/rocksdb/lib/cmake/rocksdb") set(RocksDB_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/rocksdb/include") find_package(RocksDB CONFIG REQUIRED) include_directories(${RocksDB_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of stb +# stb include_directories(${_THIRDPARTY_BUILD_DIR}/stb/include) -# -------------------------------------------------------- -# Set config of Microsoft.GSL +# Microsoft.GSL set(GSL_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/Microsoft.GSL/include") include_directories(${GSL_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of fmt +# fmt set(fmt_DIR "${_THIRDPARTY_BUILD_DIR}/fmt/lib/cmake/fmt") set(fmt_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/fmt/include") find_package(fmt CONFIG REQUIRED) include_directories(${fmt_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of spdlog v1.4.2 +# spdlog v1.4.2 set(spdlog_DIR "${_THIRDPARTY_BUILD_DIR}/spdlog/lib/cmake/spdlog") set(spdlog_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/spdlog/include") find_package(spdlog CONFIG REQUIRED) include_directories(${spdlog_INCLUDE_DIR}) add_compile_definitions("SPDLOG_FMT_EXTERNAL") -# -------------------------------------------------------- -# Set config of soralog +# soralog set(soralog_DIR "${_THIRDPARTY_BUILD_DIR}/soralog/lib/cmake/soralog") set(soralog_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/soralog/include") find_package(soralog CONFIG REQUIRED) include_directories(${soralog_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of yaml-cpp +# yaml-cpp set(yaml-cpp_DIR "${_THIRDPARTY_BUILD_DIR}/yaml-cpp/lib/cmake/yaml-cpp") set(yaml-cpp_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/yaml-cpp/include") find_package(yaml-cpp CONFIG REQUIRED) include_directories(${yaml-cpp_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of tsl_hat_trie +# tsl_hat_trie set(tsl_hat_trie_DIR "${_THIRDPARTY_BUILD_DIR}/tsl_hat_trie/lib/cmake/tsl_hat_trie") set(tsl_hat_trie_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/tsl_hat_trie/include") find_package(tsl_hat_trie CONFIG REQUIRED) include_directories(${tsl_hat_trie_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of Boost.DI +# Boost.DI set(Boost.DI_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/Boost.DI/include") set(Boost.DI_DIR "${_THIRDPARTY_BUILD_DIR}/Boost.DI/lib/cmake/Boost.DI") find_package(Boost.DI CONFIG REQUIRED) include_directories(${Boost.DI_INCLUDE_DIR}) # Boost should be loaded before libp2p v0.1.2 -# -------------------------------------------------------- -# Set config of Boost project +# Boost project set(_BOOST_ROOT "${_THIRDPARTY_BUILD_DIR}/boost/build/${CMAKE_SYSTEM_NAME}${ABI_SUBFOLDER_NAME}") set(Boost_LIB_DIR "${_BOOST_ROOT}/lib") set(Boost_INCLUDE_DIR "${_BOOST_ROOT}/include/boost-${BOOST_VERSION_2U}") @@ -177,34 +164,29 @@ endif() find_package(Boost REQUIRED COMPONENTS date_time filesystem random regex system thread log log_setup program_options) include_directories(${Boost_INCLUDE_DIRS}) -# -------------------------------------------------------- -# Set config of SQLiteModernCpp project +# SQLiteModernCpp project set(SQLiteModernCpp_ROOT_DIR "${_THIRDPARTY_BUILD_DIR}/SQLiteModernCpp") set(SQLiteModernCpp_DIR "${SQLiteModernCpp_ROOT_DIR}/lib/cmake/SQLiteModernCpp") set(SQLiteModernCpp_LIB_DIR "${SQLiteModernCpp_ROOT_DIR}/lib") set(SQLiteModernCpp_INCLUDE_DIR "${SQLiteModernCpp_ROOT_DIR}/include") -# -------------------------------------------------------- -# Set config of SQLiteModernCpp project +# SQLiteModernCpp project set(sqlite3_ROOT_DIR "${_THIRDPARTY_BUILD_DIR}/sqlite3") set(sqlite3_DIR "${sqlite3_ROOT_DIR}/lib/cmake/sqlite3") set(sqlite3_LIB_DIR "${sqlite3_ROOT_DIR}/lib") set(sqlite3_INCLUDE_DIR "${sqlite3_ROOT_DIR}/include") -# -------------------------------------------------------- -# Set config of cares +# cares set(c-ares_DIR "${_THIRDPARTY_BUILD_DIR}/cares/lib/cmake/c-ares" CACHE PATH "Path to c-ares install folder") set(c-ares_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/cares/include" CACHE PATH "Path to c-ares include folder") -# -------------------------------------------------------- -# Set config of libp2p +# libp2p set(libp2p_DIR "${_THIRDPARTY_BUILD_DIR}/libp2p/lib/cmake/libp2p") set(libp2p_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/libp2p/lib") set(libp2p_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/libp2p/include") find_package(libp2p CONFIG REQUIRED) include_directories(${libp2p_INCLUDE_DIR}) -# -------------------------------------------------------- # Find and include cares if libp2p have not included it if(NOT TARGET c-ares::cares_static) find_package(c-ares CONFIG REQUIRED) @@ -212,8 +194,7 @@ endif() include_directories(${c-ares_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of ipfs-lite-cpp +# ipfs-lite-cpp set(ipfs-lite-cpp_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-lite-cpp/lib/cmake/ipfs-lite-cpp") set(ipfs-lite-cpp_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-lite-cpp/include") set(ipfs-lite-cpp_LIB_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-lite-cpp/lib") @@ -221,128 +202,114 @@ set(CBOR_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-lite-cpp/include/deps/tinycb find_package(ipfs-lite-cpp CONFIG REQUIRED) include_directories(${ipfs-lite-cpp_INCLUDE_DIR} ${CBOR_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of ipfs-pubsub +# ipfs-pubsub set(ipfs-pubsub_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-pubsub/include") set(ipfs-pubsub_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-pubsub/lib/cmake/ipfs-pubsub") find_package(ipfs-pubsub CONFIG REQUIRED) include_directories(${ipfs-pubsub_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of ipfs-bitswap-cpp +# ipfs-bitswap-cpp set(ipfs-bitswap-cpp_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-bitswap-cpp/include") set(ipfs-bitswap-cpp_DIR "${_THIRDPARTY_BUILD_DIR}/ipfs-bitswap-cpp/lib/cmake/ipfs-bitswap-cpp") find_package(ipfs-bitswap-cpp CONFIG REQUIRED) include_directories(${ipfs-bitswap-cpp_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of ed25519 +# ed25519 set(ed25519_DIR "${_THIRDPARTY_BUILD_DIR}/ed25519/lib/cmake/ed25519") set(ed25519_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/ed25519/include") find_package(ed25519 CONFIG REQUIRED) include_directories(${ed25519_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of sr25519-donna +# sr25519-donna set(sr25519-donna_DIR "${_THIRDPARTY_BUILD_DIR}/sr25519-donna/lib/cmake/sr25519-donna") set(sr25519-donna_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/sr25519-donna/include") find_package(sr25519-donna CONFIG REQUIRED) include_directories(${sr25519-donna_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set RapidJSON config path +# RapidJSON set(RapidJSON_DIR "${_THIRDPARTY_BUILD_DIR}/rapidjson/lib/cmake/RapidJSON") set(RapidJSON_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/rapidjson/include") find_package(RapidJSON CONFIG REQUIRED) include_directories(${RapidJSON_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set jsonrpc-lean include path +# jsonrpc-lean set(jsonrpc_lean_INCLUDE_DIR "${_THIRDPARTY_DIR}/jsonrpc-lean/include") include_directories(${jsonrpc_lean_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of binaryen +# binaryen # set(binaryen_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/binaryen/include") # set(binaryen_LIBRARIES "${_THIRDPARTY_BUILD_DIR}/binaryen/lib") # set(binaryen_DIR "${_THIRDPARTY_BUILD_DIR}/binaryen/lib/cmake/binaryen") # find_package(binaryen CONFIG REQUIRED) # include_directories(${binaryen_INCLUDE_DIR} ${binaryen_INCLUDE_DIR}/binaryen) -# -------------------------------------------------------- -# Set config of secp256k1 +# secp256k1 set(libsecp256k1_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/libsecp256k1/include") set(libsecp256k1_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/libsecp256k1/lib") set(libsecp256k1_DIR "${_THIRDPARTY_BUILD_DIR}/libsecp256k1/lib/cmake/libsecp256k1") find_package(libsecp256k1 CONFIG REQUIRED) include_directories(${libsecp256k1_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of xxhash +# xxhash set(xxhash_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/xxhash/include") set(xxhash_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/xxhash/lib") set(xxhash_DIR "${_THIRDPARTY_BUILD_DIR}/xxhash/lib/cmake/xxhash") find_package(xxhash CONFIG REQUIRED) include_directories(${xxhash_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of libssh2 +# libssh2 set(Libssh2_DIR "${_THIRDPARTY_BUILD_DIR}/libssh2/lib/cmake/libssh2") set(Libssh2_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/libssh2/lib") set(Libssh2_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/libssh2/include") find_package(Libssh2 CONFIG REQUIRED) include_directories(${LIBSSH2_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of AsyncIOManager +# AsyncIOManager set(AsyncIOManager_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/AsyncIOManager/include") set(AsyncIOManager_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/AsyncIOManager/lib") set(AsyncIOManager_DIR "${_THIRDPARTY_BUILD_DIR}/AsyncIOManager/lib/cmake/AsyncIOManager") find_package(AsyncIOManager CONFIG REQUIRED) include_directories(${AsyncIOManager_INCLUDE_DIR}) -# -------------------------------------------------------- -# Set config of crypto3 -#set(crypto3_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/crypto3/include") -#set(crypto3_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/crypto3/lib") -#set(crypto3_DIR "${_THIRDPARTY_BUILD_DIR}/crypto3/lib/cmake/crypto3") -#find_package(crypto3 CONFIG REQUIRED) -#include_directories(${crypto3_INCLUDE_DIR}) + +# crypto3 +# set(crypto3_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/crypto3/include") +# set(crypto3_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/crypto3/lib") +# set(crypto3_DIR "${_THIRDPARTY_BUILD_DIR}/crypto3/lib/cmake/crypto3") +# find_package(crypto3 CONFIG REQUIRED) +# include_directories(${crypto3_INCLUDE_DIR}) include_directories( -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/algebra/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/block/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/codec/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/containers/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/hash/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/kdf/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/mac/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/math/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/algebra/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/core/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/multiprecision/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/zk/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/modes/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/multiprecision/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/passhash/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/pbkdf/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/pkpad/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/pubkey/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/random/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/stream/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/threshold/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/vdf/include" -"${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/zk/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/algebra/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/block/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/codec/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/containers/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/hash/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/kdf/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/mac/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/math/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/algebra/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/core/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/multiprecision/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/marshalling/zk/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/modes/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/multiprecision/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/passhash/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/pbkdf/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/pkpad/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/pubkey/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/random/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/stream/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/threshold/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/vdf/include" + "${THIRDPARTY_DIR}/zkLLVM/libs/crypto3/libs/zk/include" ) - -# -------------------------------------------------------- -# Set config of gnus_upnp +# gnus_upnp set(gnus_upnp_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/gnus_upnp/include") set(gnus_upnp_LIBRARY_DIR "${_THIRDPARTY_BUILD_DIR}/gnus_upnp/lib") set(gnus_upnp_DIR "${_THIRDPARTY_BUILD_DIR}/gnus_upnp/lib/cmake/gnus_upnp") find_package(gnus_upnp CONFIG REQUIRED) include_directories(${gnus_upnp_INCLUDE_DIR}) -# -------------------------------------------------------- include_directories( ${PROJECT_ROOT}/src ) @@ -366,7 +333,6 @@ print("CXX Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}") print("C Release flags: ${CMAKE_C_FLAGS_RELEASE}") print("CXX Release flags: ${CMAKE_CXX_FLAGS_RELEASE}") -# -------------------------------------------------------- link_directories( ${Boost_LIB_DIR} ${ipfs-lite-cpp_LIB_DIR} @@ -376,7 +342,6 @@ add_subdirectory(${PROJECT_ROOT}/src ${CMAKE_BINARY_DIR}/src) add_subdirectory(${PROJECT_ROOT}/GeniusKDF ${CMAKE_BINARY_DIR}/GeniusKDF) - # add_subdirectory(${PROJECT_ROOT}/app ${CMAKE_BINARY_DIR}/app) if(TESTING) enable_testing() @@ -408,7 +373,7 @@ write_basic_package_version_file( COMPATIBILITY AnyNewerVersion ) -# ## install header files ### +# install header files install_hfile(${PROJECT_ROOT}/src/api) install_hfile(${PROJECT_ROOT}/src/authorship) install_hfile(${PROJECT_ROOT}/src/application) @@ -435,7 +400,7 @@ install_hfile(${PROJECT_ROOT}/app/integration) install_hfile(${PROJECT_ROOT}/src/local_secure_storage) install_hfile(${PROJECT_ROOT}/src/singleton) -# ## install proto header files ### +# install proto header files install_hfile(${CMAKE_CURRENT_BINARY_DIR}/generated/crdt) install_hfile(${CMAKE_CURRENT_BINARY_DIR}/generated/processing) install_hfile(${CMAKE_CURRENT_BINARY_DIR}/generated/account) diff --git a/build/CommonCompilerOptions.CMake b/build/CommonCompilerOptions.cmake similarity index 92% rename from build/CommonCompilerOptions.CMake rename to build/CommonCompilerOptions.cmake index ba429acd..b5dfc5d3 100644 --- a/build/CommonCompilerOptions.CMake +++ b/build/CommonCompilerOptions.cmake @@ -1,4 +1,3 @@ -# ------------------------------------------ # Set PROJECT_ROOT folder get_filename_component(CURRENT_SOURCE_PARENT "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY ABSOLUTE) get_filename_component(PROJECT_ROOT "${CURRENT_SOURCE_PARENT}" DIRECTORY ABSOLUTE) @@ -8,7 +7,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -# Package config ###################################################################################### +# Package config set(CPACK_PACKAGE_VERSION_MAJOR "21") set(CPACK_PACKAGE_VERSION_MINOR "0") set(CPACK_PACKAGE_VERSION_PATCH "0") @@ -46,7 +45,6 @@ else() print("Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}") endif() -# -------------------------------------------------------- # define third party directory if(NOT DEFINED THIRDPARTY_DIR) if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../thirdparty/README.md") @@ -69,7 +67,8 @@ if(NOT DEFINED THIRDPARTY_BUILD_DIR) print("Setting third party build directory default") get_filename_component(BUILD_PLATFORM_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) set(THIRDPARTY_BUILD_DIR "${THIRDPARTY_DIR}/build/${BUILD_PLATFORM_NAME}/${CMAKE_BUILD_TYPE}") - if (DEFINED ANDROID_ABI) + + if(DEFINED ANDROID_ABI) set(THIRDPARTY_BUILD_DIR "${THIRDPARTY_BUILD_DIR}/${ANDROID_ABI}") endif() endif() diff --git a/build/Linux/CMakeLists.txt b/build/Linux/CMakeLists.txt index 3a603e88..fd758bc3 100644 --- a/build/Linux/CMakeLists.txt +++ b/build/Linux/CMakeLists.txt @@ -1,26 +1,21 @@ cmake_minimum_required(VERSION 3.12) -# -------------------------------------------------------- # if on Linux system, build the Linux executables if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux") message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} host system name does not match Linux - Please select the correct folder for configuring project") endif() -# -------------------------------------------------------- # Set toolchain file before the project call get_filename_component(_LINUX_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY ABSOLUTE) get_filename_component(_BUILD_FOLDER "${_LINUX_FOLDER}" DIRECTORY ABSOLUTE) set(CMAKE_TOOLCHAIN_FILE "${_BUILD_FOLDER}/cmake/toolchain/cxx17.cmake" CACHE INTERNAL "CMake toolchain file used" FORCE) -# -------------------------------------------------------- # Project project(SuperGenius C CXX) -# -------------------------------------------------------- # include common compiler options include(../CommonCompilerOptions.CMake) -# -------------------------------------------------------- # Set OS threading settings set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY ON) @@ -28,20 +23,17 @@ set(CMAKE_USE_WIN32_THREADS_INIT OFF) set(CMAKE_USE_PTHREADS_INIT ON) set(THREADS_PREFER_PTHREAD_FLAG ON) -# -------------------------------------------------------- # Allow multiple definitions set(FORCE_MULTILE ON) set(MULTIPLE_OPTION "-z muldefs") -# -------------------------------------------------------- # Set extra compiler flags set(EXTRA_CXX_FLAGS) -# -------------------------------------------------------- # Set custom subfolder for ABI set(ABI_SUBFOLDER_NAME "") find_package(Vulkan REQUIRED) set(VULKAN_LIBS Vulkan::Vulkan) -# -------------------------------------------------------- + # Include common build parameters include(../CommonBuildParameters.cmake) diff --git a/build/OSX/CMakeLists.txt b/build/OSX/CMakeLists.txt index b915d0d4..3ef87044 100644 --- a/build/OSX/CMakeLists.txt +++ b/build/OSX/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.12) -# -------------------------------------------------------- # if on OSX Darwin system, build the OSX executables if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin") message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} host system name does not match OSX Darwin - Please select the correct folder for configuring project") @@ -8,15 +7,12 @@ endif() set(CMAKE_OSX_DEPLOYMENT_TARGET "12.1" CACHE STRING "Minimum OS X deployment version" FORCE) -# -------------------------------------------------------- # Project project(SuperGenius C CXX) -# -------------------------------------------------------- # include common compiler options include(../CommonCompilerOptions.CMake) -# ------------------------------------------ # Set OSX specific runtime options set(CMAKE_OSX_ARCHITECTURES "x86_64") set(CMAKE_MACOSX_RPATH 1) @@ -31,11 +27,9 @@ if(NOT DEFINED DEPLOYMENT_TARGET AND XCODE_VERSION_INT VERSION_GREATER 12.0) set(CMAKE_XCODE_ATTRIBUTE_EXCLUDED_ARCHS[sdk=iphonesimulator*] "arm64") endif() -# -------------------------------------------------------- # Set toolchain file set(CMAKE_TOOLCHAIN_FILE "${PROJECT_ROOT}/cmake/toolchain/cxx17.cmake") -# -------------------------------------------------------- # Set OS threading settings set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY ON) @@ -43,24 +37,21 @@ set(CMAKE_USE_WIN32_THREADS_INIT OFF) set(CMAKE_USE_PTHREADS_INIT ON) set(THREADS_PREFER_PTHREAD_FLAG ON) -# -------------------------------------------------------- # Allow multiple definitions set(FORCE_MULTILE ON) set(MULTIPLE_OPTION "-Xlink=-force:multiple") -# -------------------------------------------------------- # Set extra compiler flags set(EXTRA_CXX_FLAGS) set(TESTING ON) -# -------------------------------------------------------- # Set custom subfolder for ABI set(ABI_SUBFOLDER_NAME "") set(Vulkan_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/moltenvk/build/include") set(Vulkan_LIBRARY "${_THIRDPARTY_BUILD_DIR}/moltenvk/build/lib/MoltenVK.xcframework") find_package(Vulkan REQUIRED) set(VULKAN_LIBS Vulkan::Vulkan) -# -------------------------------------------------------- + # Include common build parameters include(../CommonBuildParameters.cmake) diff --git a/build/Windows/CMakeLists.txt b/build/Windows/CMakeLists.txt index 871019bc..64447238 100644 --- a/build/Windows/CMakeLists.txt +++ b/build/Windows/CMakeLists.txt @@ -1,12 +1,10 @@ cmake_minimum_required(VERSION 3.12) -# -------------------------------------------------------- # if on Windows system, build the windows executables if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows") message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} host system name does not match Windows - Please select the correct folder for configuring project") endif() -# -------------------------------------------------------- # Project project(SuperGenius C CXX) @@ -40,7 +38,6 @@ foreach(CompilerFlag ${CompilerFlags}) string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") endforeach() -# -------------------------------------------------------- # build common libraries by platforms include(../CommonCompilerOptions.CMake) @@ -48,28 +45,23 @@ include(../CommonCompilerOptions.CMake) set(Protobuf_DIR "${_THIRDPARTY_BUILD_DIR}/grpc/cmake") set(Protobuf_INCLUDE_DIR "${_THIRDPARTY_BUILD_DIR}/grpc/include/google/protobuf") -# -------------------------------------------------------- # Set toolchain file set(CMAKE_TOOLCHAIN_FILE "${PROJECT_ROOT}/cmake/toolchain/cxx17.cmake") -# -------------------------------------------------------- # Set Windows crypto and socket library set(USER_ENV_LIBRARY userenv) set(WIN_SOCK_LIBRARY wsock32 ws2_32) set(WIN_CRYPT_LIBRARY crypt32) -# -------------------------------------------------------- # Allow multiple definitions set(FORCE_MULTILE ON) set(MULTIPLE_OPTION /FORCE:MULTIPLE) -# -------------------------------------------------------- # Set extra compiler flags set(EXTRA_CXX_FLAGS) -# -------------------------------------------------------- # Set custom subfolder for ABI set(ABI_SUBFOLDER_NAME "") -# -------------------------------------------------------- + # Include common build paramaeters include(../CommonBuildParameters.cmake) diff --git a/build/iOS/CMakeLists.txt b/build/iOS/CMakeLists.txt index 100499a0..e16fd4f5 100644 --- a/build/iOS/CMakeLists.txt +++ b/build/iOS/CMakeLists.txt @@ -1,11 +1,5 @@ cmake_minimum_required(VERSION 3.15) -# -------------------------------------------------------- -# if on OSX Darwin system, build the iOS executables -if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin") - message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} host system name does not match OSX Darwin for iOS cross compiling - Please select the correct folder for configuring project") -endif() - if(POLICY CMP0025) # NEW: report OS X version of Clang as "AppleClang" cmake_policy(SET CMP0025 NEW) @@ -18,36 +12,24 @@ endif() set(IOS_DEPLOYMENT_TARGET 13.0) -# -------------------------------------------------------- # Project project(SuperGenius C CXX) -# -------------------------------------------------------- # Set cross compiling settings set(CMAKE_SYSTEM_NAME "iOS") -#set(Protobuf_DIR "${iOS_Protobuf_DIR}") -#set(Protobuf_INCLUDE_DIR "${iOS_Protobuf_INCLUDE_DIR}") -#set(Protobuf_LIBRARIES "${iOS_Protobuf_LIBRARIES}") - -# set(Boost_USE_STATIC_RUNTIME OFF) - -# -------------------------------------------------------- # include common compiler options include(../CommonCompilerOptions.CMake) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM "BOTH") set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) -# -------------------------------------------------------- # Turn off examples set(BUILD_EXAMPLES OFF) -# -------------------------------------------------------- # Set toolchain file set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/iOS.cmake") -# -------------------------------------------------------- # Check required input args if(NOT CMAKE_TOOLCHAIN_FILE) message(FATAL_ERROR "Cannot find CMAKE_TOOLCHAIN_FILE, make sure you pass -DCMAKE_TOOLCHAIN_FILE=[arm64]") @@ -69,24 +51,19 @@ if(NOT CMAKE_SYSTEM_PROCESSOR) message(FATAL_ERROR "Cannot find CMAKE_SYSTEM_PROCESSOR, make sure you pass -DCMAKE_SYSTEM_PROCESSOR=[arm64]") endif() -# -------------------------------------------------------- # Config param for android set(ENABLE_ARC "0") set(ENABLE_BITCODE NO) set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH YES) -# -------------------------------------------------------- # Set host system protoc executable path - set(PROTOC_EXECUTABLE "${_THIRDPARTY_BUILD_DIR}/protobuf_host/bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") -# -------------------------------------------------------- # Set custom protobuf path for iOS set(iOS_Protobuf_DIR "${THIRDPARTY_BUILD_DIR}/protobuf/lib/cmake/protobuf") set(iOS_Protobuf_INCLUDE_DIR "${THIRDPARTY_BUILD_DIR}/protobuf/include/google/protobuf") set(iOS_Protobuf_LIBRARIES "${THIRDPARTY_BUILD_DIR}/protobuf/lib") -# -------------------------------------------------------- # Set OS threading settings set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY ON) @@ -94,20 +71,16 @@ set(CMAKE_USE_WIN32_THREADS_INIT OFF) set(CMAKE_USE_PTHREADS_INIT ON) set(THREADS_PREFER_PTHREAD_FLAG ON) -# -------------------------------------------------------- # Allow multiple definitions set(FORCE_MULTILE ON) set(MULTIPLE_OPTION "-Xlink=-force:multiple") -# -------------------------------------------------------- # Set extra compiler flags set(EXTRA_CXX_FLAGS -std=c++17) -# -------------------------------------------------------- # Set custom subfolder for ABI set(ABI_SUBFOLDER_NAME "/aarch64") set(TESTING OFF) -# -------------------------------------------------------- # Include common build paramaeters include(../CommonBuildParameters.cmake)