From 77fc77a2bff01b2001494c74fe059dde96617a9d Mon Sep 17 00:00:00 2001 From: Matthieu HERNANDEZ Date: Thu, 7 Nov 2024 20:49:20 +0100 Subject: [PATCH] Fix clang under Windows compilation --- .github/workflows/dataset_tests.yml | 9 ++------- CMakeLists.txt | 4 ++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dataset_tests.yml b/.github/workflows/dataset_tests.yml index 073b0f9a..eae0a840 100644 --- a/.github/workflows/dataset_tests.yml +++ b/.github/workflows/dataset_tests.yml @@ -11,14 +11,9 @@ on: jobs: unit-tests: name: Build and run - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - name: Set up GCC - uses: egor-tensin/setup-gcc@v1.3 - with: - version: 13 - platform: x64 - name: Checkout projet uses: actions/checkout@v2 - name: Checkout datasets @@ -29,7 +24,7 @@ jobs: - name: CMake run: | cd ./build - CXX=/usr/bin/g++-13 cmake -G"Unix Makefiles" ./.. -DCMAKE_BUILD_TYPE=Release + CC=/usr/bin/gcc-14 CXX=/usr/bin/g++-14 cmake -G"Unix Makefiles" ./.. -DCMAKE_BUILD_TYPE=Release - name: make run: | cd ./build diff --git a/CMakeLists.txt b/CMakeLists.txt index 2efd4de9..b012f43f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,9 @@ if(MSVC) else() set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math") + if(WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_ALL_NO_LIB -fms-runtime-lib=static") + endif() endif() add_subdirectory(src) @@ -64,4 +67,5 @@ if(MSVC) else() target_compile_options(StraightforwardNeuralNetwork PUBLIC -fopenmp -Wall -Wextra -pedantic -Werror -Wno-unused-parameter) target_compile_options(Boost INTERFACE -w) + target_compile_options(gtest INTERFACE -w) endif() \ No newline at end of file