From 952237b4980559d79d173fc2bcc27f9c2b59b7c0 Mon Sep 17 00:00:00 2001 From: Suthiro Date: Sat, 3 Oct 2020 01:45:29 +0700 Subject: [PATCH 01/62] Allows one to easily link the library with C++ code. --- include/fmem.h.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/fmem.h.in b/include/fmem.h.in index 4db7a4a..0c63dba 100644 --- a/include/fmem.h.in +++ b/include/fmem.h.in @@ -10,10 +10,14 @@ struct fmem_reserved { }; typedef struct fmem_reserved fmem; - +#ifdef __cplusplus +extern "C" { +#endif FMEM_API void fmem_init(fmem *file); FMEM_API void fmem_term(fmem *file); FMEM_API FILE *fmem_open(fmem *file, const char *mode); FMEM_API void fmem_mem(fmem *file, void **mem, size_t *size); - +#ifdef __cplusplus +} +#endif #endif /* !FMEM_H_ */ From bdce2760f0190253600f11984220fc0a007742c8 Mon Sep 17 00:00:00 2001 From: Maxim Samsonov Date: Sun, 18 Jul 2021 12:33:47 +0300 Subject: [PATCH 02/62] Fix fmem.h installation issue https://github.com/Snaipe/fmem/issues/3 https://github.com/Snaipe/fmem/issues/3 --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e4fc3e..a422b05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,10 +115,9 @@ install(TARGETS fmem ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES - fmem.h - ${PROJECT_BINARY_DIR}/gen/fmem-export.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - + ${PROJECT_BINARY_DIR}/gen/fmem.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + include (CTest) if (BUILD_TESTING) From 70898417b3c72fdb5c59f4c1c85ecc64c07780c7 Mon Sep 17 00:00:00 2001 From: Phytolizer Date: Tue, 12 Apr 2022 02:03:05 -0500 Subject: [PATCH 03/62] only build testing on top-level project --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e4fc3e..ba8837b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ install(FILES include (CTest) -if (BUILD_TESTING) +if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) find_package (Criterion REQUIRED) add_subdirectory (test) endif () From 08e3065451edd925a5c947b30b598cc8faa4f275 Mon Sep 17 00:00:00 2001 From: Phytolizer Date: Tue, 12 Apr 2022 02:04:49 -0500 Subject: [PATCH 04/62] alias target --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba8837b..18b04fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ endif () include_directories (include src ${PROJECT_BINARY_DIR}/gen) add_library (fmem ${SOURCES}) +add_library (fmem::fmem ALIAS fmem) get_property (FMEM_LIBTYPE TARGET fmem From 7fc7c264307ce5ccf8c2d19751e40691f0784727 Mon Sep 17 00:00:00 2001 From: Phytolizer Date: Tue, 12 Apr 2022 02:07:23 -0500 Subject: [PATCH 05/62] target_include_directories for inheritance --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18b04fc..2c2acd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,9 +74,9 @@ else () message (FATAL_ERROR "No memory stream implementation found") endif () -include_directories (include src ${PROJECT_BINARY_DIR}/gen) add_library (fmem ${SOURCES}) add_library (fmem::fmem ALIAS fmem) +target_include_directories (fmem PUBLIC include src "${PROJECT_BINARY_DIR}/gen") get_property (FMEM_LIBTYPE TARGET fmem From 0fe079c35db8f9a5ebef487bec2b0172dfb4ea15 Mon Sep 17 00:00:00 2001 From: Kreijstal Date: Fri, 10 Nov 2023 13:27:21 +0100 Subject: [PATCH 06/62] Create cmake-multi-platform.yml Trying out CI --- .github/workflows/cmake-multi-platform.yml | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml new file mode 100644 index 0000000..9ec0432 --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1,75 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake on multiple platforms + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # 3. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest] + build_type: [Release] + c_compiler: [gcc, clang, cl] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + exclude: + - os: windows-latest + c_compiler: gcc + - os: windows-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: cl + + steps: + - uses: actions/checkout@v3 + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} From 31aa88936da3f0e6310253f5132da9cae946fa90 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 13:51:52 +0100 Subject: [PATCH 07/62] Add test alternative using meson and git --- CMakeLists.txt | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08ab227..575c955 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,9 +119,34 @@ install(FILES ${PROJECT_BINARY_DIR}/gen/fmem.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +# Check if this is the main project and BUILD_TESTING was not already set by the user +if("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND NOT DEFINED BUILD_TESTING) + message(WARNING "Detected that we're only compiling this project. BUILD_TESTING was not explicitly set, defaulting to BUILD_TESTING=ON. To disable testing, set BUILD_TESTING=OFF.") +endif() + include (CTest) if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) - find_package (Criterion REQUIRED) - add_subdirectory (test) -endif () + find_package(Criterion QUIET) + if (NOT CRITERION_FOUND) + find_program(MESON_FOUND meson) + if (MESON_FOUND) + message(STATUS "Criterion not installed, cloning and building from source.") + + # Clone the Criterion repository + execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git) + + # Navigate to the Criterion directory and run Meson build commands + execute_process(COMMAND ${CMAKE_COMMAND} -E chdir Criterion meson build) + execute_process(COMMAND ${CMAKE_COMMAND} -E chdir Criterion meson compile -C build) + + set(CRITERION_INCLUDE_DIRS "Criterion/include") + set(CRITERION_LIBRARIES "Criterion/build/src") + # Adjust paths as needed + else() + message(FATAL_ERROR "Meson build system not found. Unable to build Criterion from source.") + endif() + endif() + + add_subdirectory(test) +endif() From 923107ab5af6ac1e7790951a3376596c29aced1f Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:00:54 +0100 Subject: [PATCH 08/62] Fix CI by adding meson, will it work? --- .github/workflows/cmake-multi-platform.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9ec0432..f67b0a9 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -46,6 +46,17 @@ jobs: steps: - uses: actions/checkout@v3 + # Add Meson installation steps here + - name: Install Meson (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y meson + + - name: Install Meson (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install meson - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 50c73e83f3f6e0fdcf0baf23d8bfec0d80c06e7c Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:15:30 +0100 Subject: [PATCH 09/62] Change tests and CMake in such a way to not depend on system libraries --- test/CMakeLists.txt | 6 +++++- test/tests.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 519bf48..3d9da8f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,10 @@ set (TEST_SOURCES tests.c) -include_directories (SYSTEM ${CRITERION_INCLUDE_DIRS}) +if(NOT CRITERION_FOUND) + include_directories("${CRITERION_INCLUDE_DIRS}") +else() + include_directories(SYSTEM ${CRITERION_INCLUDE_DIRS}/criterion/) +endif() add_executable (unit_tests ${TEST_SOURCES}) target_link_libraries (unit_tests fmem ${CRITERION_LIBRARIES}) diff --git a/test/tests.c b/test/tests.c index b199c67..4faed22 100644 --- a/test/tests.c +++ b/test/tests.c @@ -1,4 +1,4 @@ -#include +#include #include #include "fmem.h" From cdced5ffd8f62be19b213f0186c26aded822a625 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:27:40 +0100 Subject: [PATCH 10/62] ci debug1 --- CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 575c955..7c4881a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,13 +135,22 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Clone the Criterion repository execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git) + + set(CRITERION_INCLUDE_DIRS "Criterion/include") + set(CRITERION_LIBRARIES "Criterion/build/src") + + # Check if criterion.h exists in the provided include directory + if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion.h") + message(STATUS "Found criterion.h in: ${CRITERION_INCLUDE_DIRS}") + else() + message(FATAL_ERROR "criterion.h not found in: ${CRITERION_INCLUDE_DIRS}") + endif() # Navigate to the Criterion directory and run Meson build commands execute_process(COMMAND ${CMAKE_COMMAND} -E chdir Criterion meson build) execute_process(COMMAND ${CMAKE_COMMAND} -E chdir Criterion meson compile -C build) - set(CRITERION_INCLUDE_DIRS "Criterion/include") - set(CRITERION_LIBRARIES "Criterion/build/src") + # Adjust paths as needed else() message(FATAL_ERROR "Meson build system not found. Unable to build Criterion from source.") From 9426f517f2812fab11016f40c56b83c0a424ac00 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:29:50 +0100 Subject: [PATCH 11/62] ci debug2 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c4881a..e0123dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,8 +136,8 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Clone the Criterion repository execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git) - set(CRITERION_INCLUDE_DIRS "Criterion/include") - set(CRITERION_LIBRARIES "Criterion/build/src") + set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") + set(CRITERION_LIBRARIES "${PROJECT_SOURCE_DIR}/build/src") # Check if criterion.h exists in the provided include directory if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion.h") From 28ed3e47b1ed64cb6345039545bbeb67979d1960 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:33:10 +0100 Subject: [PATCH 12/62] ci debug3 --- CMakeLists.txt | 6 +++--- test/CMakeLists.txt | 2 +- test/tests.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0123dc..93af2d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,10 +140,10 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) set(CRITERION_LIBRARIES "${PROJECT_SOURCE_DIR}/build/src") # Check if criterion.h exists in the provided include directory - if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion.h") - message(STATUS "Found criterion.h in: ${CRITERION_INCLUDE_DIRS}") + if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion/criterion.h") + message(STATUS "Found criterion.h in: ${CRITERION_INCLUDE_DIRS}/criterion") else() - message(FATAL_ERROR "criterion.h not found in: ${CRITERION_INCLUDE_DIRS}") + message(FATAL_ERROR "criterion.h not found in: ${CRITERION_INCLUDE_DIRS}/criterion") endif() # Navigate to the Criterion directory and run Meson build commands diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3d9da8f..66b75ba 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,7 +3,7 @@ set (TEST_SOURCES tests.c) if(NOT CRITERION_FOUND) include_directories("${CRITERION_INCLUDE_DIRS}") else() - include_directories(SYSTEM ${CRITERION_INCLUDE_DIRS}/criterion/) + include_directories(SYSTEM ${CRITERION_INCLUDE_DIRS}) endif() add_executable (unit_tests ${TEST_SOURCES}) diff --git a/test/tests.c b/test/tests.c index 4faed22..b199c67 100644 --- a/test/tests.c +++ b/test/tests.c @@ -1,4 +1,4 @@ -#include +#include #include #include "fmem.h" From 736930c876d4f8e1bbae2bf3f0e0e49564f00032 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:40:15 +0100 Subject: [PATCH 13/62] ci debug4 --- test/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 66b75ba..19c45f0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,10 +1,6 @@ set (TEST_SOURCES tests.c) -if(NOT CRITERION_FOUND) - include_directories("${CRITERION_INCLUDE_DIRS}") -else() - include_directories(SYSTEM ${CRITERION_INCLUDE_DIRS}) -endif() +include_directories(SYSTEM ${CRITERION_INCLUDE_DIRS}) add_executable (unit_tests ${TEST_SOURCES}) target_link_libraries (unit_tests fmem ${CRITERION_LIBRARIES}) From 664a6998b13f3a7b2983080f8544f98844773f9a Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:50:36 +0100 Subject: [PATCH 14/62] ci debug5 --- test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 19c45f0..d3be7db 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,8 @@ set (TEST_SOURCES tests.c) -include_directories(SYSTEM ${CRITERION_INCLUDE_DIRS}) +include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") add_executable (unit_tests ${TEST_SOURCES}) -target_link_libraries (unit_tests fmem ${CRITERION_LIBRARIES}) +target_link_libraries (unit_tests fmem "${CRITERION_LIBRARIES}") add_test (unit_tests unit_tests) From d8295466faa2c92b3546290f9a29675bdd909f12 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 14:52:12 +0100 Subject: [PATCH 15/62] ci debug6 --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d3be7db..645fc60 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,7 +2,7 @@ set (TEST_SOURCES tests.c) include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") -add_executable (unit_tests ${TEST_SOURCES}) +add_executable (unit_tests "${TEST_SOURCES}") target_link_libraries (unit_tests fmem "${CRITERION_LIBRARIES}") add_test (unit_tests unit_tests) From 5961ca64fc00242e14a6792c8e50c04c18c171e6 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 18:17:33 +0100 Subject: [PATCH 16/62] ci debug7 --- test/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 645fc60..8619ac4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,6 +3,9 @@ set (TEST_SOURCES tests.c) include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") add_executable (unit_tests "${TEST_SOURCES}") +# Add a debug message +message(STATUS "Linking unit_tests with libraries: fmem, ${CRITERION_LIBRARIES}") + target_link_libraries (unit_tests fmem "${CRITERION_LIBRARIES}") add_test (unit_tests unit_tests) From 574e39654cd5667c82485ef6ee9a8807fc49b22e Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 18:27:09 +0100 Subject: [PATCH 17/62] ci debug8 --- CMakeLists.txt | 9 +++++++-- test/CMakeLists.txt | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93af2d3..3c271b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,8 +133,13 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) if (MESON_FOUND) message(STATUS "Criterion not installed, cloning and building from source.") - # Clone the Criterion repository - execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git) + # Check if the Criterion directory already exists + if(NOT EXISTS "${PROJECT_SOURCE_DIR}/Criterion") + message(STATUS "Criterion source not found, cloning from repository.") + execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git) + else() + message(STATUS "Criterion source found, skipping clone.") + endif() set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") set(CRITERION_LIBRARIES "${PROJECT_SOURCE_DIR}/build/src") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8619ac4..1712f05 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,6 +2,9 @@ set (TEST_SOURCES tests.c) include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") +# Add a debug message for test sources +message(STATUS "Adding executable for unit_tests with sources: ${TEST_SOURCES}") + add_executable (unit_tests "${TEST_SOURCES}") # Add a debug message message(STATUS "Linking unit_tests with libraries: fmem, ${CRITERION_LIBRARIES}") From 6f578aab147699b2008cb4d04bd9b27faa74e5f9 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 19:25:08 +0100 Subject: [PATCH 18/62] ci debug9 --- CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c271b6..0ef638d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,16 +133,19 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) if (MESON_FOUND) message(STATUS "Criterion not installed, cloning and building from source.") - # Check if the Criterion directory already exists + # Clone Criterion into the project root directory if(NOT EXISTS "${PROJECT_SOURCE_DIR}/Criterion") - message(STATUS "Criterion source not found, cloning from repository.") - execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git) - else() - message(STATUS "Criterion source found, skipping clone.") + execute_process(COMMAND git clone --depth=1 https://github.com/Snaipe/Criterion.git "${PROJECT_SOURCE_DIR}/Criterion") endif() + # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") - set(CRITERION_LIBRARIES "${PROJECT_SOURCE_DIR}/build/src") + if (WIN32) + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/build/src/libcriterion.dll.a") # For Windows + else() + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/build/src/libcriterion.a") # For Linux and other Unix-like systems + endif() + # Check if criterion.h exists in the provided include directory if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion/criterion.h") @@ -150,17 +153,14 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) else() message(FATAL_ERROR "criterion.h not found in: ${CRITERION_INCLUDE_DIRS}/criterion") endif() - - # Navigate to the Criterion directory and run Meson build commands - execute_process(COMMAND ${CMAKE_COMMAND} -E chdir Criterion meson build) - execute_process(COMMAND ${CMAKE_COMMAND} -E chdir Criterion meson compile -C build) + # Build Criterion in a subdirectory within the main build directory + execute_process(COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_SOURCE_DIR}/Criterion" meson "${CMAKE_BINARY_DIR}/Criterion") + execute_process(COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_SOURCE_DIR}/Criterion" meson compile -C "${CMAKE_BINARY_DIR}/Criterion") - - # Adjust paths as needed else() message(FATAL_ERROR "Meson build system not found. Unable to build Criterion from source.") endif() endif() add_subdirectory(test) -endif() +endif() \ No newline at end of file From 645b7aa05a72c77984ddd0401b72a234e2f2fc5d Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 19:31:06 +0100 Subject: [PATCH 19/62] ci debug10 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ef638d..887a98b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,9 +141,9 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") if (WIN32) - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/build/src/libcriterion.dll.a") # For Windows + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.dll.a") # For Windows else() - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/build/src/libcriterion.a") # For Linux and other Unix-like systems + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.a") # For Linux and other Unix-like systems endif() From 2d93420f56be09bbe1c422cc0762eb6f09a2362f Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 19:36:20 +0100 Subject: [PATCH 20/62] ci debug11 --- CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 887a98b..aa4c098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,13 +140,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") - if (WIN32) - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.dll.a") # For Windows - else() - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.a") # For Linux and other Unix-like systems - endif() - - + file(GLOB CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/build/src/*") # Check if criterion.h exists in the provided include directory if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion/criterion.h") message(STATUS "Found criterion.h in: ${CRITERION_INCLUDE_DIRS}/criterion") From 3b4340e1551e7a970575b64a66690d7a14655ed4 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 19:45:00 +0100 Subject: [PATCH 21/62] ci debug12 --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa4c098..887a98b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,13 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") - file(GLOB CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/build/src/*") + if (WIN32) + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.dll.a") # For Windows + else() + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.a") # For Linux and other Unix-like systems + endif() + + # Check if criterion.h exists in the provided include directory if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion/criterion.h") message(STATUS "Found criterion.h in: ${CRITERION_INCLUDE_DIRS}/criterion") From 8b5f3936517ee5d0931a9dfd7fb2d5b5dc69fa33 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 20:55:34 +0100 Subject: [PATCH 22/62] ci debug13 --- test/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1712f05..2e4f200 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,8 @@ set (TEST_SOURCES tests.c) +file(GLOB ALL_LIB_A_FILES "${CMAKE_BINARY_DIR}/Criterion/subprojects/*/src/*.a") +message(STATUS "Found .a files: ${ALL_LIB_A_FILES}") -include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") +include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}" "${ALL_LIB_A_FILES}") # Add a debug message for test sources message(STATUS "Adding executable for unit_tests with sources: ${TEST_SOURCES}") From 03c2c5b9e9fa73676f0ea26b3e248251713eec55 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 21:04:31 +0100 Subject: [PATCH 23/62] ci debug14 --- test/CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2e4f200..9062319 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,18 @@ set (TEST_SOURCES tests.c) -file(GLOB ALL_LIB_A_FILES "${CMAKE_BINARY_DIR}/Criterion/subprojects/*/src/*.a") -message(STATUS "Found .a files: ${ALL_LIB_A_FILES}") +# Append additional libraries to CRITERION_LIBRARIES if they exist +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") +endif() -include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}" "${ALL_LIB_A_FILES}") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") +endif() + +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") +endif() + +include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") # Add a debug message for test sources message(STATUS "Adding executable for unit_tests with sources: ${TEST_SOURCES}") From bc0c83059f3444d0dbad5c5bddfe27bbb122f3bf Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 21:08:18 +0100 Subject: [PATCH 24/62] ci debug15 --- test/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9062319..9f2bbf1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,11 @@ if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") endif() +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") +endif() + + include_directories(SYSTEM "${CRITERION_INCLUDE_DIRS}") # Add a debug message for test sources From 1ba7c36296a3e2421b5477271200b9e70e144626 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 21:14:37 +0100 Subject: [PATCH 25/62] ci debug18 --- test/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9f2bbf1..1c37b39 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,6 +14,21 @@ endif() if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") +else() + # Execute the find program to locate libgit2.a + execute_process( + COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2.a + OUTPUT_VARIABLE FOUND_LIBGIT2 + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + # If found, append to CRITERION_LIBRARIES + if(FOUND_LIBGIT2) + message(STATUS "Found libgit2.a at: ${FOUND_LIBGIT2}") + list(APPEND CRITERION_LIBRARIES "${FOUND_LIBGIT2}") + else() + message(WARNING "libgit2.a not found in Criterion subprojects.") + endif() endif() From a41e875dfef76361c3168d8fbf409ba2db2f1734 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 21:19:54 +0100 Subject: [PATCH 26/62] ci debug19 --- CMakeLists.txt | 14 +++++++++----- test/CMakeLists.txt | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 887a98b..18a07c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,13 @@ endif() include (CTest) +# Set the library file extension based on the operating system +if (WIN32) + set(LIB_EXT ".dll.a") +else() + set(LIB_EXT ".a") +endif() + if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) find_package(Criterion QUIET) if (NOT CRITERION_FOUND) @@ -140,11 +147,8 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") - if (WIN32) - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.dll.a") # For Windows - else() - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.a") # For Linux and other Unix-like systems - endif() + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion${CRITERION_LIB_EXT}") # For Windows + # Check if criterion.h exists in the provided include directory diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1c37b39..6359203 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,33 +1,33 @@ set (TEST_SOURCES tests.c) # Append additional libraries to CRITERION_LIBRARIES if they exist -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/libgit2${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/libgit2${LIB_EXT}") else() - # Execute the find program to locate libgit2.a + # Execute the find program to locate libgit2${LIB_EXT} execute_process( - COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2.a + COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2${LIB_EXT} OUTPUT_VARIABLE FOUND_LIBGIT2 OUTPUT_STRIP_TRAILING_WHITESPACE ) # If found, append to CRITERION_LIBRARIES if(FOUND_LIBGIT2) - message(STATUS "Found libgit2.a at: ${FOUND_LIBGIT2}") + message(STATUS "Found libgit2${LIB_EXT} at: ${FOUND_LIBGIT2}") list(APPEND CRITERION_LIBRARIES "${FOUND_LIBGIT2}") else() - message(WARNING "libgit2.a not found in Criterion subprojects.") + message(WARNING "libgit2${LIB_EXT} not found in Criterion subprojects.") endif() endif() From 8a597f5a4fd07ef7bebb518361c3753a9baddba0 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 21:47:25 +0100 Subject: [PATCH 27/62] Revert "ci debug19" This reverts commit a41e875dfef76361c3168d8fbf409ba2db2f1734. --- CMakeLists.txt | 14 +++++--------- test/CMakeLists.txt | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18a07c3..887a98b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,13 +126,6 @@ endif() include (CTest) -# Set the library file extension based on the operating system -if (WIN32) - set(LIB_EXT ".dll.a") -else() - set(LIB_EXT ".a") -endif() - if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) find_package(Criterion QUIET) if (NOT CRITERION_FOUND) @@ -147,8 +140,11 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion${CRITERION_LIB_EXT}") # For Windows - + if (WIN32) + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.dll.a") # For Windows + else() + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.a") # For Linux and other Unix-like systems + endif() # Check if criterion.h exists in the provided include directory diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6359203..1c37b39 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,33 +1,33 @@ set (TEST_SOURCES tests.c) # Append additional libraries to CRITERION_LIBRARIES if they exist -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg${LIB_EXT}") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg${LIB_EXT}") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static${LIB_EXT}") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static${LIB_EXT}") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/libgit2${LIB_EXT}") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/libgit2${LIB_EXT}") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") else() - # Execute the find program to locate libgit2${LIB_EXT} + # Execute the find program to locate libgit2.a execute_process( - COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2${LIB_EXT} + COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2.a OUTPUT_VARIABLE FOUND_LIBGIT2 OUTPUT_STRIP_TRAILING_WHITESPACE ) # If found, append to CRITERION_LIBRARIES if(FOUND_LIBGIT2) - message(STATUS "Found libgit2${LIB_EXT} at: ${FOUND_LIBGIT2}") + message(STATUS "Found libgit2.a at: ${FOUND_LIBGIT2}") list(APPEND CRITERION_LIBRARIES "${FOUND_LIBGIT2}") else() - message(WARNING "libgit2${LIB_EXT} not found in Criterion subprojects.") + message(WARNING "libgit2.a not found in Criterion subprojects.") endif() endif() From 7e23c55e6be0774e569eaaf21e89c6224a8df1b3 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 21:56:23 +0100 Subject: [PATCH 28/62] Ci 20 --- .github/workflows/cmake-multi-platform.yml | 13 +++++----- CMakeLists.txt | 29 ++++++++++++++++------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index f67b0a9..27d6633 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -37,12 +37,8 @@ jobs: c_compiler: clang cpp_compiler: clang++ exclude: - - os: windows-latest - c_compiler: gcc - os: windows-latest c_compiler: clang - - os: ubuntu-latest - c_compiler: cl steps: - uses: actions/checkout@v3 @@ -53,10 +49,13 @@ jobs: sudo apt-get update sudo apt-get install -y meson - - name: Install Meson (Windows) + - name: Install MinGW and Meson (Windows) if: matrix.os == 'windows-latest' - run: | - choco install meson + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 + - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. diff --git a/CMakeLists.txt b/CMakeLists.txt index 887a98b..3bd13eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,11 +125,31 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND NOT DEFINED BUILD_ endif() include (CTest) - +if (WIN32) + set(LIB_EXT ".dll.a") +else() + set(LIB_EXT ".a") +endif() + if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) find_package(Criterion QUIET) if (NOT CRITERION_FOUND) find_program(MESON_FOUND meson) + + if(NOT MESON_FOUND) + message(STATUS "Meson not found. Attempting to call meson --version for debugging.") + execute_process( + COMMAND meson --version + RESULT_VARIABLE MESON_VERSION_RESULT + OUTPUT_VARIABLE MESON_VERSION_OUTPUT + ERROR_QUIET + ) + if(MESON_VERSION_RESULT EQUAL 0) + message(STATUS "Meson version: ${MESON_VERSION_OUTPUT}") + else() + message(WARNING "Meson not found or not callable from the shell.") + endif() +endif() if (MESON_FOUND) message(STATUS "Criterion not installed, cloning and building from source.") @@ -140,12 +160,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) # Set include directories and library paths set(CRITERION_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/Criterion/include") - if (WIN32) - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.dll.a") # For Windows - else() - set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion.a") # For Linux and other Unix-like systems - endif() - + set(CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/src/libcriterion${LIB_EXT}") # Check if criterion.h exists in the provided include directory if(EXISTS "${CRITERION_INCLUDE_DIRS}/criterion/criterion.h") From 74feb32cf8f93e56e2c92334179fd3e3b2b5ae73 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:02:09 +0100 Subject: [PATCH 29/62] Ci 21 --- .github/workflows/cmake-multi-platform.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 27d6633..b860cca 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -25,7 +25,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] build_type: [Release] - c_compiler: [gcc, clang, cl] + c_compiler: [gcc, clang] include: - os: windows-latest c_compiler: cl diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bd13eb..5b5cc94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,7 +139,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) if(NOT MESON_FOUND) message(STATUS "Meson not found. Attempting to call meson --version for debugging.") execute_process( - COMMAND meson --version + COMMAND mingw-w64-x86_64-meson --version RESULT_VARIABLE MESON_VERSION_RESULT OUTPUT_VARIABLE MESON_VERSION_OUTPUT ERROR_QUIET From fc8aaf4ab0352e6a8a046e6b537271f8a416bb6a Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:05:38 +0100 Subject: [PATCH 30/62] Ci 22 --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b860cca..a8c660a 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -28,8 +28,8 @@ jobs: c_compiler: [gcc, clang] include: - os: windows-latest - c_compiler: cl - cpp_compiler: cl + c_compiler: gcc + cpp_compiler: g++ - os: ubuntu-latest c_compiler: gcc cpp_compiler: g++ From 90f889fb71c740b51027115a9d3bc7beb1027316 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:14:41 +0100 Subject: [PATCH 31/62] Ci 23 --- .github/workflows/cmake-multi-platform.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index a8c660a..74524ff 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,6 +40,9 @@ jobs: - os: windows-latest c_compiler: clang + defaults: + run: + shell: msys2 {0} steps: - uses: actions/checkout@v3 # Add Meson installation steps here From 0aaa232be1856fd667ea9e7a10b2f2e5e1091169 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:19:32 +0100 Subject: [PATCH 32/62] Ci 24 --- .github/workflows/cmake-multi-platform.yml | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 74524ff..2d1a9ec 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -67,22 +67,41 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: > + - name: Configure CMake (Windows) + if: matrix.os == 'windows-latest' + run: | + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + shell: msys2 {0} + + - name: Configure CMake (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} - - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + - name: Build (Windows) + if: matrix.os == 'windows-latest' + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + shell: msys2 {0} + + - name: Build (Ubuntu) + if: matrix.os == 'ubuntu-latest' run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - name: Test + - name: Test (Windows) + if: matrix.os == 'windows-latest' working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} + shell: msys2 {0} + + - name: Test (Ubuntu) + if: matrix.os == 'ubuntu-latest' + working-directory: ${{ steps.strings.outputs.build-output-dir }} + run: ctest --build-config ${{ matrix.build_type }} \ No newline at end of file From b1bdad46a264345538a9a88a59b287866cea547d Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:20:47 +0100 Subject: [PATCH 33/62] Ci 25 --- .github/workflows/cmake-multi-platform.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2d1a9ec..57d3bfb 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,9 +40,7 @@ jobs: - os: windows-latest c_compiler: clang - defaults: - run: - shell: msys2 {0} + steps: - uses: actions/checkout@v3 # Add Meson installation steps here From 7973ef9857726672b5396e37ce69a9b9bebdd343 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:24:03 +0100 Subject: [PATCH 34/62] Ci 26 --- .github/workflows/cmake-multi-platform.yml | 37 ++++++---------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 57d3bfb..470d8da 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -65,41 +65,22 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Configure CMake (Windows) - if: matrix.os == 'windows-latest' - run: | - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ github.workspace }} - shell: msys2 {0} - - - name: Configure CMake (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} - - name: Build (Windows) - if: matrix.os == 'windows-latest' - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - shell: msys2 {0} - - - name: Build (Ubuntu) - if: matrix.os == 'ubuntu-latest' + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - name: Test (Windows) - if: matrix.os == 'windows-latest' + - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} - shell: msys2 {0} - - - name: Test (Ubuntu) - if: matrix.os == 'ubuntu-latest' - working-directory: ${{ steps.strings.outputs.build-output-dir }} - run: ctest --build-config ${{ matrix.build_type }} \ No newline at end of file From ed31c9fd493dccf6026fd1348b236a0c1c7e82e6 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:25:45 +0100 Subject: [PATCH 35/62] Ci 27 --- .github/workflows/cmake-multi-platform.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 470d8da..1478fdd 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -56,7 +56,10 @@ jobs: with: msystem: MINGW64 install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 - + env: | + MSYS2_ARG_CONV_EXCL="*" + MSYS_NO_PATHCONV=1 + PATH=${{ env.MSYS2_PATH }}\mingw64\bin;${{ env.MSYS2_PATH }}\usr\bin;${{ env.PATH }} - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 3dcc0d76547b41238885f5bd6595479f1084d76a Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:29:24 +0100 Subject: [PATCH 36/62] Ci 28 --- .github/workflows/cmake-multi-platform.yml | 18 ++++++++++++++++-- CMakeLists.txt | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 1478fdd..d4f0f3c 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -68,9 +68,21 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + + - name: Configure CMake (Windows) + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + if: matrix.os == 'windows-latest' + run: | + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + shell: msys2 {0} + + - name: Configure CMake + if: matrix.os == 'ubuntu-latest' run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} @@ -78,6 +90,8 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} + + - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b5cc94..3bd13eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,7 +139,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" AND BUILD_TESTING) if(NOT MESON_FOUND) message(STATUS "Meson not found. Attempting to call meson --version for debugging.") execute_process( - COMMAND mingw-w64-x86_64-meson --version + COMMAND meson --version RESULT_VARIABLE MESON_VERSION_RESULT OUTPUT_VARIABLE MESON_VERSION_OUTPUT ERROR_QUIET From fd7a77adb5f95689852dec7d94bf528d1fbdde16 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:32:25 +0100 Subject: [PATCH 37/62] Ci 29 --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index d4f0f3c..631672b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -55,7 +55,7 @@ jobs: uses: msys2/setup-msys2@v2 with: msystem: MINGW64 - install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 + install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake env: | MSYS2_ARG_CONV_EXCL="*" MSYS_NO_PATHCONV=1 @@ -81,7 +81,7 @@ jobs: -S ${{ github.workspace }} shell: msys2 {0} - - name: Configure CMake + - name: Configure CMake (Ubuntu) if: matrix.os == 'ubuntu-latest' run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} From fc64624964af6fd5de4961f7dbafad380341b801 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:38:58 +0100 Subject: [PATCH 38/62] Ci 30 --- .github/workflows/cmake-multi-platform.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 631672b..15f8c88 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -56,10 +56,7 @@ jobs: with: msystem: MINGW64 install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake - env: | - MSYS2_ARG_CONV_EXCL="*" - MSYS_NO_PATHCONV=1 - PATH=${{ env.MSYS2_PATH }}\mingw64\bin;${{ env.MSYS2_PATH }}\usr\bin;${{ env.PATH }} + upgrade: true - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From e0f4107298606e5c4c8b9de9fb37a96cdadda3d4 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:54:25 +0100 Subject: [PATCH 39/62] Ci 31 --- .github/workflows/cmake-multi-platform.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 15f8c88..9b5374b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -61,10 +61,9 @@ jobs: - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings - shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - + shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} - name: Configure CMake (Windows) # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. @@ -76,16 +75,7 @@ jobs: -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} - shell: msys2 {0} - - - name: Configure CMake (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ github.workspace }} + shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} From 5f391bdea812cfc2cfef54c9d0fdf548bb4e25dd Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:55:32 +0100 Subject: [PATCH 40/62] Ci 32 --- .github/workflows/cmake-multi-platform.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9b5374b..d7fe2e3 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -75,7 +75,16 @@ jobs: -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} - shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} + shell: msys2 {0} + + - name: Configure CMake (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} From 4beb0134fc2e5008c54c7c052af45b2b21a599a4 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:57:01 +0100 Subject: [PATCH 41/62] Ci 33 --- .github/workflows/cmake-multi-platform.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index d7fe2e3..7aa8d5c 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -61,9 +61,18 @@ jobs: - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings + if: matrix.os == 'ubuntu-latest' + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + if: matrix.os == 'windows-latest' + shell: msys2 {0} run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} - name: Configure CMake (Windows) # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 89f0e05c55ab9da01697963d8cce3b94ead88951 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:57:48 +0100 Subject: [PATCH 42/62] Ci 34 --- .github/workflows/cmake-multi-platform.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 7aa8d5c..15f8c88 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -61,18 +61,10 @@ jobs: - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings - if: matrix.os == 'ubuntu-latest' shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - if: matrix.os == 'windows-latest' - shell: msys2 {0} - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Configure CMake (Windows) # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 70fab450d6e22c637bb0ebaf4940e9864f5c5ec0 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:58:26 +0100 Subject: [PATCH 43/62] Ci 35 --- .github/workflows/cmake-multi-platform.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 15f8c88..9c313ff 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -58,9 +58,11 @@ jobs: install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake upgrade: true + - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings + if: matrix.os == 'ubuntu-latest' shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" From 103dbee6e03c4853baae1f0d3fb29958159353f2 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 22:59:00 +0100 Subject: [PATCH 44/62] Ci 36 --- .github/workflows/cmake-multi-platform.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9c313ff..af62d99 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -67,6 +67,12 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: Set reusable strings + id: strings + if: matrix.os == 'windows-latest' + shell: msys2 {0} + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Configure CMake (Windows) # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From ccc9d37d29103053edfeb0aea352d0ea72d1d6c5 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:03:03 +0100 Subject: [PATCH 45/62] Ci 37 --- .github/workflows/cmake-multi-platform.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index af62d99..b6e1719 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -62,17 +62,10 @@ jobs: - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings - if: matrix.os == 'ubuntu-latest' - shell: bash + shell: ${{ (matrix.os == 'windows-latest') && 'msys2 {0}' || 'bash' }} run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Set reusable strings - id: strings - if: matrix.os == 'windows-latest' - shell: msys2 {0} - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Configure CMake (Windows) # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From f571614bed2c1f1ea4903168a504510efe630693 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:04:40 +0100 Subject: [PATCH 46/62] Ci 38 --- .github/workflows/cmake-multi-platform.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b6e1719..212e932 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -59,10 +59,16 @@ jobs: upgrade: true - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + - name: Set reusable strings (Windows) + if: matrix.os == 'windows-latest' + id: strings + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + shell: msys2 {0} + + - name: Set reusable strings (Other OS) + if: matrix.os != 'windows-latest' id: strings - shell: ${{ (matrix.os == 'windows-latest') && 'msys2 {0}' || 'bash' }} run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" From 1a6718a4e41437953a69f7488c4cdc77b00d68fc Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:10:18 +0100 Subject: [PATCH 47/62] Ci 39 --- .github/workflows/cmake-multi-platform.yml | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 212e932..5919639 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -11,6 +11,8 @@ on: jobs: build: runs-on: ${{ matrix.os }} + env: + BUILD_OUTPUT_DIR: ${{ github.workspace }}/build strategy: # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. @@ -59,26 +61,12 @@ jobs: upgrade: true - - name: Set reusable strings (Windows) - if: matrix.os == 'windows-latest' - id: strings - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - shell: msys2 {0} - - - name: Set reusable strings (Other OS) - if: matrix.os != 'windows-latest' - id: strings - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: Configure CMake (Windows) # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type if: matrix.os == 'windows-latest' run: | - cmake -B ${{ steps.strings.outputs.build-output-dir }} + cmake -B $BUILD_OUTPUT_DIR -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} @@ -88,7 +76,7 @@ jobs: - name: Configure CMake (Ubuntu) if: matrix.os == 'ubuntu-latest' run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} + cmake -B $BUILD_OUTPUT_DIR -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} @@ -98,10 +86,10 @@ jobs: - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + run: cmake --build $BUILD_OUTPUT_DIR --config ${{ matrix.build_type }} - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} + working-directory: $BUILD_OUTPUT_DIR # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} From 846fa10bd976b08698f7407d0f719520bdc35f83 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:15:06 +0100 Subject: [PATCH 48/62] Ci 40 --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 5919639..1a6a1a6 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -89,7 +89,7 @@ jobs: run: cmake --build $BUILD_OUTPUT_DIR --config ${{ matrix.build_type }} - name: Test - working-directory: $BUILD_OUTPUT_DIR + working-directory: ${{ env.BUILD_OUTPUT_DIR }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} From c2bd2f44d83d1f584d1247622afcb27d50aeb688 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:16:42 +0100 Subject: [PATCH 49/62] Ci 41 --- .github/workflows/cmake-multi-platform.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 1a6a1a6..6285653 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -67,9 +67,6 @@ jobs: if: matrix.os == 'windows-latest' run: | cmake -B $BUILD_OUTPUT_DIR - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} shell: msys2 {0} From 317ba14228e5fc5194ce6e97535ac0ec424045a2 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:27:50 +0100 Subject: [PATCH 50/62] Ci 42 --- test/CMakeLists.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1c37b39..509d578 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,23 +1,29 @@ set (TEST_SOURCES tests.c) +if (WIN32) + set(LIB_EXT ".dll.a") +else() + set(LIB_EXT ".a") +endif() + # Append additional libraries to CRITERION_LIBRARIES if they exist -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanomsg/libnanomsg${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/nanopb/libprotobuf_nanopb_static${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2.a") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2${LIB_EXT}") else() # Execute the find program to locate libgit2.a execute_process( - COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2.a + COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2${LIB_EXT} OUTPUT_VARIABLE FOUND_LIBGIT2 OUTPUT_STRIP_TRAILING_WHITESPACE ) From 1865b9707c9a7aca7354f56976f57eb3246ff63f Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:29:08 +0100 Subject: [PATCH 51/62] Ci 43 --- .github/workflows/cmake-multi-platform.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 6285653..ae9ceae 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -66,8 +66,7 @@ jobs: # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type if: matrix.os == 'windows-latest' run: | - cmake -B $BUILD_OUTPUT_DIR - -S ${{ github.workspace }} + cmake -B $BUILD_OUTPUT_DIR -S ${{ github.workspace }} shell: msys2 {0} - name: Configure CMake (Ubuntu) From da286ff4c1ae7d895819764988a2a416ad064588 Mon Sep 17 00:00:00 2001 From: CI <-ci@not-real.com> Date: Fri, 10 Nov 2023 23:30:11 +0100 Subject: [PATCH 52/62] Ci 44 --- .github/workflows/cmake-multi-platform.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index ae9ceae..cbdfbde 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -80,10 +80,16 @@ jobs: - - name: Build + - name: Build (Windows) + if: matrix.os == 'windows-latest' + shell: msys2 {0} # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build $BUILD_OUTPUT_DIR --config ${{ matrix.build_type }} + - name: Build (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: cmake --build $BUILD_OUTPUT_DIR --config ${{ matrix.build_type }}s + - name: Test working-directory: ${{ env.BUILD_OUTPUT_DIR }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). From f404cec80f56d0a75bdbed1de1d63519bae036e9 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Fri, 10 Nov 2023 23:37:06 +0100 Subject: [PATCH 53/62] Ci 51 --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index cbdfbde..ebed48f 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -66,7 +66,7 @@ jobs: # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type if: matrix.os == 'windows-latest' run: | - cmake -B $BUILD_OUTPUT_DIR -S ${{ github.workspace }} + cmake -B $BUILD_OUTPUT_DIR -G"MSYS Makefiles" -S $BUILD_OUTPUT_DIR/.. shell: msys2 {0} - name: Configure CMake (Ubuntu) From d66d69d5412b47ef33ea0c90ceb01c397b607139 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Fri, 10 Nov 2023 23:47:49 +0100 Subject: [PATCH 54/62] Ci 52 --- .github/workflows/cmake-multi-platform.yml | 13 +++++++++++-- test/CMakeLists.txt | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index ebed48f..33979a4 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -88,10 +88,19 @@ jobs: - name: Build (Ubuntu) if: matrix.os == 'ubuntu-latest' - run: cmake --build $BUILD_OUTPUT_DIR --config ${{ matrix.build_type }}s + run: cmake --build $BUILD_OUTPUT_DIR --config ${{ matrix.build_type }} - - name: Test + - name: Test (Ubuntu) working-directory: ${{ env.BUILD_OUTPUT_DIR }} + if: matrix.os == 'ubuntu-latest' # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} + + - name: Test (Windows) + working-directory: ${{ env.BUILD_OUTPUT_DIR }} + if: matrix.os == 'windows-latest' + shell: msys2 {0} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 509d578..cf303d0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -21,9 +21,9 @@ endif() if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2${LIB_EXT}") list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2${LIB_EXT}") else() - # Execute the find program to locate libgit2.a + # Execute the find program to locate libgit2.a don't write libgit2${LIB_EXT} because FIND: Parameter format not correct execute_process( - COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2${LIB_EXT} + COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2 OUTPUT_VARIABLE FOUND_LIBGIT2 OUTPUT_STRIP_TRAILING_WHITESPACE ) From f2635fb39429a602201c50f4a2515b87e0314c2c Mon Sep 17 00:00:00 2001 From: kreijstal Date: Fri, 10 Nov 2023 23:54:18 +0100 Subject: [PATCH 55/62] Ci 45 --- .github/workflows/cmake-multi-platform.yml | 2 -- test/CMakeLists.txt | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 33979a4..6921bb8 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -93,8 +93,6 @@ jobs: - name: Test (Ubuntu) working-directory: ${{ env.BUILD_OUTPUT_DIR }} if: matrix.os == 'ubuntu-latest' - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} - name: Test (Windows) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cf303d0..fa8c661 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,12 +18,12 @@ if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/boxfort/src/libboxfort${LIB_EXT}") endif() -if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2${LIB_EXT}") - list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/src/libgit2${LIB_EXT}") +if(EXISTS "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/libgit2${LIB_EXT}") + list(APPEND CRITERION_LIBRARIES "${CMAKE_BINARY_DIR}/Criterion/subprojects/libgit2/libgit2${LIB_EXT}") else() # Execute the find program to locate libgit2.a don't write libgit2${LIB_EXT} because FIND: Parameter format not correct execute_process( - COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2 + COMMAND find "${CMAKE_BINARY_DIR}/Criterion" -name libgit2${LIB_EXT} OUTPUT_VARIABLE FOUND_LIBGIT2 OUTPUT_STRIP_TRAILING_WHITESPACE ) From d9011984dc3d5352da483e9193e31eb36fe5062f Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 00:01:28 +0100 Subject: [PATCH 56/62] Ci 46 --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 6921bb8..bee0ceb 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -101,4 +101,4 @@ jobs: shell: msys2 {0} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} \ No newline at end of file + run: ctest --build-config ${{ matrix.build_type }} --rerun-failed --output-on-failure \ No newline at end of file From d885d1c28fa72abcdddb33a07e7968a9a894bc86 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 00:07:58 +0100 Subject: [PATCH 57/62] Ci 47 --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index bee0ceb..4c97e47 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -101,4 +101,4 @@ jobs: shell: msys2 {0} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} --rerun-failed --output-on-failure \ No newline at end of file + run: ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file From 25f4e465ae770c4a257ec4eb010dea79951df56f Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 00:21:30 +0100 Subject: [PATCH 58/62] Ci 48 --- .github/workflows/cmake-multi-platform.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 4c97e47..51a3229 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -99,6 +99,6 @@ jobs: working-directory: ${{ env.BUILD_OUTPUT_DIR }} if: matrix.os == 'windows-latest' shell: msys2 {0} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file + run: | + export PATH="$BUILD_OUTPUT_DIR/Criterion/build/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" + ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file From 95c1f671b1e076a247db6399d1d846cf6ba19d95 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 08:11:02 +0100 Subject: [PATCH 59/62] Ci 49 --- .github/workflows/cmake-multi-platform.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 51a3229..c71d3c5 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false # Set up a matrix to run the following 3 configurations: - # 1. + # 1. # 2. # 3. # @@ -57,7 +57,7 @@ jobs: uses: msys2/setup-msys2@v2 with: msystem: MINGW64 - install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake + install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake mingw-w64-x86_64-ntldd upgrade: true @@ -100,5 +100,5 @@ jobs: if: matrix.os == 'windows-latest' shell: msys2 {0} run: | - export PATH="$BUILD_OUTPUT_DIR/Criterion/build/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" + PATH="$BUILD_OUTPUT_DIR/Criterion/build/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" ntldd ctest --build-config ${{ matrix.build_type }} --output-on-failure ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file From fecf3e01f0e36b1868f5ec0259b52e28be3f1649 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 08:20:35 +0100 Subject: [PATCH 60/62] Ci 50 --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index c71d3c5..936a7b0 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -100,5 +100,5 @@ jobs: if: matrix.os == 'windows-latest' shell: msys2 {0} run: | - PATH="$BUILD_OUTPUT_DIR/Criterion/build/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" ntldd ctest --build-config ${{ matrix.build_type }} --output-on-failure + PATH="$BUILD_OUTPUT_DIR/Criterion/build/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" ntldd test/unit_tests.exe ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file From 4400c3d77ef1c9b7ba4eb5462b74a6302ab49694 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 08:30:18 +0100 Subject: [PATCH 61/62] Ci 16 --- .github/workflows/cmake-multi-platform.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 936a7b0..2cd9f48 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -100,5 +100,6 @@ jobs: if: matrix.os == 'windows-latest' shell: msys2 {0} run: | - PATH="$BUILD_OUTPUT_DIR/Criterion/build/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" ntldd test/unit_tests.exe + export PATH="$BUILD_OUTPUT_DIR/Criterion/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" + ntldd test/unit_tests.exe ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file From 7490523725f037643d81bf2cb0aa92c18c431215 Mon Sep 17 00:00:00 2001 From: kreijstal Date: Sat, 11 Nov 2023 08:40:36 +0100 Subject: [PATCH 62/62] Ci 17 --- .github/workflows/cmake-multi-platform.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2cd9f48..1ce2c7a 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -57,7 +57,7 @@ jobs: uses: msys2/setup-msys2@v2 with: msystem: MINGW64 - install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake mingw-w64-x86_64-ntldd + install: mingw-w64-x86_64-meson mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja base-devel git mingw-w64-x86_64-cmake upgrade: true @@ -93,7 +93,12 @@ jobs: - name: Test (Ubuntu) working-directory: ${{ env.BUILD_OUTPUT_DIR }} if: matrix.os == 'ubuntu-latest' - run: ctest --build-config ${{ matrix.build_type }} + run: | + ctest --build-config ${{ matrix.build_type }} --output-on-failure + if [ $? -ne 0 ]; then + cat Testing/Temporary/LastTest.log + exit 1 + fi - name: Test (Windows) working-directory: ${{ env.BUILD_OUTPUT_DIR }} @@ -101,5 +106,8 @@ jobs: shell: msys2 {0} run: | export PATH="$BUILD_OUTPUT_DIR/Criterion/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanomsg:$BUILD_OUTPUT_DIR/Criterion/subprojects/nanopb:$BUILD_OUTPUT_DIR/Criterion/subprojects/boxfort/src:$BUILD_OUTPUT_DIR/Criterion/subprojects/libgit2:$PATH" - ntldd test/unit_tests.exe - ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file + ctest --build-config ${{ matrix.build_type }} --output-on-failure + if [ $? -ne 0 ]; then + cat Testing/Temporary/LastTest.log + exit 1 + fi \ No newline at end of file