From 35ff22f0358858abbf47af2a3e875e679e754cd7 Mon Sep 17 00:00:00 2001 From: Mika Lindqvist Date: Sat, 14 Sep 2024 05:35:56 +0300 Subject: [PATCH] Build fixes for gcc 15 and newer cmake versions. * Update Cirrus and AppVeyor CI runners --- .appveyor.yml | 4 ++-- .cirrus.yml | 2 +- .github/workflows/cmake.yml | 2 ++ CMakeLists.txt | 4 +++- external/rocksdb/include/rocksdb/compaction_filter.h | 1 + external/rocksdb/include/rocksdb/filter_policy.h | 1 + external/rocksdb/port/port_posix.cc | 2 +- src/CryptoNoteCore/IBlockchainCacheFactory.h | 2 ++ 8 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 2d7edc6e..28408dfb 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,7 +27,7 @@ for: build_script: - md build - cd build - - cmake -DBOOST_ROOT=C:\Libraries\boost_1_77_0 -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_77_0\lib64-msvc-14.2 -G "Visual Studio 16 2019" .. + - cmake -DBOOST_ROOT=C:\Libraries\boost_1_83_0 -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_83_0\lib64-msvc-14.2 -G "Visual Studio 16 2019" .. - cmake --build . --config Release - @@ -38,5 +38,5 @@ for: build_script: - md build - cd build - - cmake -DBOOST_ROOT=C:\Libraries\boost_1_78_0 -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_78_0\lib64-msvc-14.2 -G "Visual Studio 17 2022" .. + - cmake -DBOOST_ROOT=C:\Libraries\boost_1_83_0 -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_83_0\lib64-msvc-14.2 -G "Visual Studio 17 2022" .. - cmake --build . --config Release \ No newline at end of file diff --git a/.cirrus.yml b/.cirrus.yml index 9213a7ef..271cb1b1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,7 @@ task: freebsd_instance: matrix: - - image_family: freebsd-13-2 + - image_family: freebsd-13-3 - image_family: freebsd-14-0 install_script: pkg install -y git cmake boost-all miniupnpc openssl diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ca5a7ac8..82f927e6 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -109,6 +109,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install packages run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index cff801f0..87a7650e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.7) cmake_policy(SET CMP0048 NEW) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30") + cmake_policy(SET CMP0167 OLD) +endif() -set(VERSION "0.1") # $Format:Packaged from commit %H%nset(COMMIT %h)%nset(REFS "%d")$ set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/external/rocksdb/include/rocksdb/compaction_filter.h b/external/rocksdb/include/rocksdb/compaction_filter.h index 344b1001..e7c4797d 100644 --- a/external/rocksdb/include/rocksdb/compaction_filter.h +++ b/external/rocksdb/include/rocksdb/compaction_filter.h @@ -10,6 +10,7 @@ #define STORAGE_ROCKSDB_INCLUDE_COMPACTION_FILTER_H_ #include +#include #include #include #include diff --git a/external/rocksdb/include/rocksdb/filter_policy.h b/external/rocksdb/include/rocksdb/filter_policy.h index 452d1913..dc7f1f3e 100644 --- a/external/rocksdb/include/rocksdb/filter_policy.h +++ b/external/rocksdb/include/rocksdb/filter_policy.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/external/rocksdb/port/port_posix.cc b/external/rocksdb/port/port_posix.cc index 129933bb..ec46f781 100644 --- a/external/rocksdb/port/port_posix.cc +++ b/external/rocksdb/port/port_posix.cc @@ -189,7 +189,7 @@ void *cacheline_aligned_alloc(size_t size) { return malloc(size); #elif defined(_ISOC11_SOURCE) return aligned_alloc(CACHE_LINE_SIZE, size); -#elif ( _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__APPLE__)) +#elif ( (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || defined(__APPLE__)) void *m; errno = posix_memalign(&m, CACHE_LINE_SIZE, size); return errno ? NULL : m; diff --git a/src/CryptoNoteCore/IBlockchainCacheFactory.h b/src/CryptoNoteCore/IBlockchainCacheFactory.h index 6d07eb66..bc21230c 100644 --- a/src/CryptoNoteCore/IBlockchainCacheFactory.h +++ b/src/CryptoNoteCore/IBlockchainCacheFactory.h @@ -1,4 +1,5 @@ // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers +// Copyright (c) 2024, The Talleo developers // // This file is part of Bytecoin. // @@ -17,6 +18,7 @@ #pragma once +#include #include namespace CryptoNote {