From b1121a9067c0ad4e46964b5c927a9aed5fb43f00 Mon Sep 17 00:00:00 2001 From: larsevj Date: Tue, 23 Jul 2024 13:57:00 +0200 Subject: [PATCH] Add back windows build workflow --- .github/workflows/windows.yml | 47 +++++++++++++++++++++++++++++++++++ CMakeLists.txt | 6 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..8aed2b66c --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,47 @@ +name: Windows Compile + +on: + push: + branches: + - main + - 'version-**' + tags: "*" + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + build-cmake: + name: CMake + + strategy: + fail-fast: false + matrix: + os: ['windows-2019'] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + with: + # required for `git describe --tags` to work + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python.exe -m pip install --upgrade pip + python.exe -m pip install "conan<2" + + - name: Build ResData + run: | + python.exe -m pip install -r requirements.txt + mkdir cmake-build + cmake -S . -B cmake-build -G "Visual Studio 16 2019" + cmake --build cmake-build diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2852ef6..773bd6328 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) include(GNUInstallDirs) include(TestBigEndian) -option(BUILD_TESTS "Should the tests be built" ON) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + option(BUILD_TESTS "Should the tests be built" OFF) +else() + option(BUILD_TESTS "Should the tests be built" ON) +endif() option(BUILD_APPLICATIONS "Should we build small utility applications" OFF) option(BUILD_RD_SUMMARY "Build the commandline application rd_summary" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" ON)