diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 502a6e1a..5f739f2b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -528,6 +528,11 @@ jobs: path: 'SuperGenius' submodules: "recursive" + - name: Install Ninja + run: | + brew install ccache ninja + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + - name: Install bindgen run: cargo install cbindgen @@ -557,7 +562,7 @@ jobs: - name: Thirdparty Compile working-directory: ${{github.workspace}}/thirdparty/build/iOS/Release - run: make -j8 + run: cmake --build . -j --config Release - name: Create Build Directory run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/iOS/Release @@ -568,7 +573,7 @@ jobs: - name: Compile working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release - run: make -j8 + run: cmake --build . -j --config Release - name: Install working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release diff --git a/build/iOS/CMakeLists.txt b/build/iOS/CMakeLists.txt index 504635f7..fea8120f 100644 --- a/build/iOS/CMakeLists.txt +++ b/build/iOS/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.22) if(POLICY CMP0025) # NEW: report OS X version of Clang as "AppleClang" @@ -49,9 +49,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) 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") diff --git a/src/base/blob.hpp b/src/base/blob.hpp index 53622685..78fb2caf 100644 --- a/src/base/blob.hpp +++ b/src/base/blob.hpp @@ -39,8 +39,9 @@ namespace sgns::base { * @brief constructor enabling initializer list * @param l initializer list */ - explicit Blob(const std::array &l) { - std::copy(l.begin(), l.end(), this->begin()); + explicit constexpr Blob( const std::array &l ) + { + std::copy( l.begin(), l.end(), this->begin() ); } /** diff --git a/src/primitives/common.hpp b/src/primitives/common.hpp index 8a7a5683..9ee64bfd 100644 --- a/src/primitives/common.hpp +++ b/src/primitives/common.hpp @@ -1,5 +1,3 @@ - - #ifndef SUPERGENIUS_SRC_PRIMITIVES_COMMON_HPP #define SUPERGENIUS_SRC_PRIMITIVES_COMMON_HPP @@ -19,10 +17,11 @@ namespace sgns::primitives { // (BlockInfo, Prevote, Precommit, PrimaryPropose) template struct BlockInfoT : public boost::equality_comparable> { - BlockInfoT() = default; + constexpr BlockInfoT() = default; - BlockInfoT(const BlockNumber &n, const BlockHash &h) - : block_number(n), block_hash(h) {} + constexpr BlockInfoT( BlockNumber n, BlockHash h ) : block_number( n ), block_hash( h ) + { + } BlockNumber block_number{}; BlockHash block_hash; diff --git a/src/processing/CMakeLists.txt b/src/processing/CMakeLists.txt index 313f6879..4fa1517d 100644 --- a/src/processing/CMakeLists.txt +++ b/src/processing/CMakeLists.txt @@ -57,18 +57,23 @@ target_include_directories(processing_service if(APPLE) set(XCFRAMEWORK_PATH "${_THIRDPARTY_BUILD_DIR}/moltenvk/build/lib/MoltenVK.xcframework") - target_link_libraries(processing_service PRIVATE - "-framework CoreFoundation" - "-framework CoreGraphics" - "-framework CoreServices" - "-framework IOKit" - "-framework IOSurface" - "-framework Metal" - "-framework QuartzCore" - "-framework AppKit" -# ${XCFRAMEWORK_PATH} - "-framework Foundation" - ) + target_link_libraries(processing_service PRIVATE + "-framework CoreFoundation" + "-framework CoreGraphics" + "-framework CoreServices" + "-framework IOKit" + "-framework IOSurface" + "-framework Metal" + "-framework QuartzCore" + + # ${XCFRAMEWORK_PATH} + "-framework Foundation" + ) + + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + target_link_libraries(processing_service PRIVATE + "-framework AppKit") + endif() endif() target_link_libraries(processing_service PRIVATE diff --git a/src/verification/authority/impl/schedule_node.hpp b/src/verification/authority/impl/schedule_node.hpp index f47d004e..42a794c1 100644 --- a/src/verification/authority/impl/schedule_node.hpp +++ b/src/verification/authority/impl/schedule_node.hpp @@ -27,7 +27,7 @@ namespace sgns::authority { std::shared_ptr makeDescendant( const primitives::BlockInfo &block, bool finalized = false); - const primitives::BlockInfo block; + const primitives::BlockInfo block{}; std::weak_ptr parent; std::vector> descendants; diff --git a/src/verification/finality/voter_set.hpp b/src/verification/finality/voter_set.hpp index dda33cf1..67de3340 100644 --- a/src/verification/finality/voter_set.hpp +++ b/src/verification/finality/voter_set.hpp @@ -4,6 +4,7 @@ #define SUPERGENIUS_SRC_VERIFICATION_FINALITY_VOTER_SET_HPP #include +#include #include "verification/finality/common.hpp"