From f2cf7a45c062a9c35bb3f436f56ab0c28fbe6680 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Thu, 16 Jan 2020 15:57:23 +0100 Subject: CMake: Use static MSVC runtime, fixes #1692 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9f6563..60fd8a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) +cmake_policy(SET CMP0091 NEW) project(ninja) if(CMAKE_BUILD_TYPE MATCHES "Release") @@ -15,6 +16,7 @@ if(CMAKE_BUILD_TYPE MATCHES "Release") endif() if(MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /GR- /Zc:__cplusplus") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fdiagnostics-color") -- cgit v1.2.1 From e0f4e3406d173a82ed62afd09ff063ae98ecf17a Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Fri, 17 Jan 2020 23:50:10 +0100 Subject: GitHub Actions: Split Windows and macOS workflows Somehow `$(find ./build -name ninja -or -name ninja.exe)` stopped working on Windows. --- .github/workflows/macos.yml | 49 +++++++++++++++++++++ .github/workflows/release-ninja-binaries.yml | 64 ---------------------------- .github/workflows/windows.yml | 49 +++++++++++++++++++++ 3 files changed, 98 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/release-ninja-binaries.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..2a7c100 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,49 @@ +name: macOS + +on: + pull_request: + push: + release: + types: published + +jobs: + build: + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v1 + + - name: Install dependencies + run: brew install re2c p7zip cmake + + - name: Build ninja + shell: bash + run: | + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + cmake --build . --parallel --config Release + ctest -vv + + - name: Create ninja archive + shell: bash + run: | + mkdir artifact + 7z a artifact/ninja-mac.zip ./build/ninja + + # Upload ninja binary archive as an artifact + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: ninja-binary-archives + path: artifact + + - name: Upload release asset + if: github.event.action == 'published' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./artifact/ninja-mac.zip + asset_name: ninja-mac.zip + asset_content_type: application/zip diff --git a/.github/workflows/release-ninja-binaries.yml b/.github/workflows/release-ninja-binaries.yml deleted file mode 100644 index 8c1e0af..0000000 --- a/.github/workflows/release-ninja-binaries.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Release Ninja Binaries - -on: - pull_request: - push: - release: - types: published - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macOS-latest, windows-latest] - include: - - os: macOS-latest - zip_name: ninja-mac - - os: windows-latest - zip_name: ninja-win - - steps: - - uses: actions/checkout@v1 - - # Install OS specific dependencies - - name: Install macOS dependencies - if: matrix.os == 'macOS-latest' - run: brew install re2c p7zip cmake - - name: Install Windows dependencies - if: matrix.os == 'windows-latest' - run: choco install re2c - - - name: Build ninja - shell: bash - run: | - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - cmake --build . --parallel --config Release - ctest -vv - - - name: Create ninja archive - shell: bash - env: - ZIP_NAME: ${{ matrix.zip_name }} - run: | - mkdir artifact - 7z a artifact/${ZIP_NAME}.zip $(find ./build -name ninja -or -name ninja.exe) - - # Upload ninja binary archive as an artifact - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: ninja-binary-archives - path: artifact - - - name: Upload release asset - if: github.event.action == 'published' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./artifact/${{ matrix.zip_name }}.zip - asset_name: ${{ matrix.zip_name }}.zip - asset_content_type: application/zip diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..bdec6c9 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,49 @@ +name: Windows + +on: + pull_request: + push: + release: + types: published + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + + - name: Install dependencies + run: choco install re2c + + - name: Build ninja + shell: bash + run: | + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + cmake --build . --parallel --config Release + ctest -vv + + - name: Create ninja archive + shell: bash + run: | + mkdir artifact + 7z a artifact/ninja-win.zip ./build/Release/ninja.exe + + # Upload ninja binary archive as an artifact + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: ninja-binary-archives + path: artifact + + - name: Upload release asset + if: github.event.action == 'published' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./artifact/ninja-win.zip + asset_name: ninja-win.zip + asset_content_type: application/zip -- cgit v1.2.1