From ed133b4541dc9b19074da18ae1916c6d4e4a13c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Thu, 9 May 2024 20:21:54 +0200 Subject: [PATCH 1/8] Switch benchmarks to modules --- CMakeLists.txt | 2 +- src/database/benchmarks/CMakeLists.txt | 9 ++++++++- src/database/benchmarks/main.cpp | 4 +--- src/database/benchmarks/photo_fetch_benchmarks.cpp | 8 ++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5e34602c2..b3bf79ad30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.25) +cmake_minimum_required(VERSION 3.28) project(PhotoBroom VERSION 1.7.0 LANGUAGES CXX) if(POLICY CMP0140) diff --git a/src/database/benchmarks/CMakeLists.txt b/src/database/benchmarks/CMakeLists.txt index 05a40121ab..9ad3a61c81 100644 --- a/src/database/benchmarks/CMakeLists.txt +++ b/src/database/benchmarks/CMakeLists.txt @@ -1,6 +1,13 @@ -add_executable(backends_benchmark +add_executable(backends_benchmark) + +target_sources(backends_benchmark + PUBLIC main.cpp +) + +target_sources(backends_benchmark + PUBLIC FILE_SET CXX_MODULES FILES photo_fetch_benchmarks.cpp ) diff --git a/src/database/benchmarks/main.cpp b/src/database/benchmarks/main.cpp index 8b53d49b65..a71ac7dd52 100644 --- a/src/database/benchmarks/main.cpp +++ b/src/database/benchmarks/main.cpp @@ -1,9 +1,7 @@ #include -void BM_get_photo_delta(); -void BM_fetch_photo_delta(); - +import photoDeltaFetchingBenchmarks; int main(int argc, char** argv) { diff --git a/src/database/benchmarks/photo_fetch_benchmarks.cpp b/src/database/benchmarks/photo_fetch_benchmarks.cpp index 8039951ccb..485be15af5 100644 --- a/src/database/benchmarks/photo_fetch_benchmarks.cpp +++ b/src/database/benchmarks/photo_fetch_benchmarks.cpp @@ -1,4 +1,6 @@ +module; + #include #include #include @@ -12,6 +14,8 @@ #include +export module photoDeltaFetchingBenchmarks; + namespace { void fillBackendWithData(Database::IBackend& backend) @@ -99,7 +103,7 @@ namespace } -void BM_get_photo_delta() +export void BM_get_photo_delta() { for_each_backend(fillBackendWithData, [](Database::IBackend& backend) { @@ -116,7 +120,7 @@ void BM_get_photo_delta() } -void BM_fetch_photo_delta() +export void BM_fetch_photo_delta() { for_each_backend(fillBackendWithData, [](Database::IBackend& backend) { From dd77113a62ad5fd31c51ab6b3abdd97a18c44775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sat, 24 Aug 2024 21:49:54 +0200 Subject: [PATCH 2/8] Use gcc 14 --- .github/workflows/linux-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 547a68f21d..1cfe08aaa9 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: compiler: - - { compiler: GNU, CC: gcc, CXX: g++ } + - { compiler: GNU, CC: gcc-14, CXX: g++-14 } - { compiler: LLVM, CC: clang-16, CXX: clang++-16 } build: [Release] shared: [TRUE, FALSE] From 963cbf73454805e54ded1bd90ede8e02e2f184ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sat, 24 Aug 2024 22:50:37 +0200 Subject: [PATCH 3/8] Bump c++ version to 23 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3bf79ad30..800b98db85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ set(CMAKE_MODULE_PATH set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) From 376cf4917a293e28e5619d7666da4be697bd6c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 25 Aug 2024 09:24:51 +0200 Subject: [PATCH 4/8] Use default clang --- .github/workflows/linux-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 1cfe08aaa9..78609d9549 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -20,7 +20,7 @@ jobs: matrix: compiler: - { compiler: GNU, CC: gcc-14, CXX: g++-14 } - - { compiler: LLVM, CC: clang-16, CXX: clang++-16 } + - { compiler: LLVM, CC: clang, CXX: clang++ } build: [Release] shared: [TRUE, FALSE] os: [ubuntu-24.04] From 23ce5fa0a5c514a044cf0245be25ed0351a99ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 25 Aug 2024 09:55:53 +0200 Subject: [PATCH 5/8] Force Ninja --- .github/workflows/linux-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 78609d9549..d2a647914e 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -99,6 +99,7 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_SANITIZERS_FOR_TESTS=${{ env.ENABLE_SANITIZERS }} -DPython=/usr/bin/python3 + -G Ninja run-test: true ctest-options: -LE HeavyData From da4b89a779c846ff3a3d4d72ec62d3cdaa1bd4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 25 Aug 2024 11:29:00 +0200 Subject: [PATCH 6/8] Disable gcc build gcc-14 on ubuntu crashes. Possible fix in gcc-15: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115159 --- .github/workflows/linux-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index d2a647914e..7a777a8574 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: compiler: - - { compiler: GNU, CC: gcc-14, CXX: g++-14 } + # - { compiler: GNU, CC: gcc-14, CXX: g++-14 } - { compiler: LLVM, CC: clang, CXX: clang++ } build: [Release] shared: [TRUE, FALSE] From bea71d0e9a074191888939aa434a4a21a637462d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 25 Aug 2024 13:49:37 +0200 Subject: [PATCH 7/8] Adapt codecov workflow --- .github/workflows/codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 335a0d2ac6..3efe1ccde8 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -84,6 +84,8 @@ jobs: with: build-dir: ${{ runner.workspace }}/build build-type: Debug + cc: clang + cxx: clang++ configure-options: -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DCMAKE_C_COMPILER_LAUNCHER=ccache @@ -94,6 +96,7 @@ jobs: -DCMAKE_CXX_FLAGS=--coverage -DCMAKE_SHARED_LINKER_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage + -G Ninja run-test: true ctest-options: --output-on-failure From 971eef9a2ea4ff842c58272df748e3f7c0e2dec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Tue, 26 Nov 2024 21:30:35 +0100 Subject: [PATCH 8/8] Force Ninja --- .github/workflows/macos-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 525cb2389f..2f101dc380 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -28,6 +28,7 @@ jobs: brew link --overwrite pkgconf brew install \ llvm \ + ninja \ dlib \ exiv2 \ opencv \ @@ -48,6 +49,9 @@ jobs: with: build-dir: ${{ runner.workspace }}/build build-type: Release - configure-options: -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON + configure-options: + -DBUILD_TESTING=OFF + -DBUILD_SHARED_LIBS=ON + -G Ninja env: VERBOSE: 1