forked from capstone-engine/capstone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake presets + simple CMake Workflow
- Loading branch information
MACHIZAUD Andréa
committed
Apr 3, 2022
1 parent
54726a1
commit 008a05f
Showing
3 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CMake | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macOS-latest | ||
- ubuntu-20.04 | ||
- windows-2022 | ||
include: | ||
- os: windows-2022 | ||
platform: windows | ||
- os: ubuntu-20.04 | ||
platform: linux | ||
- os: macOS-latest | ||
platform: macos | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: lukka/get-cmake@latest | ||
name: Get CMake | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
name: Setup Windows dev environment | ||
with: | ||
arch: 'x64' | ||
if: ${{ matrix.platform == 'windows' }} | ||
|
||
- name: 'Configure, Build and Install' | ||
run: | | ||
cmake --preset=${{ matrix.platform }}-x64 | ||
cmake --build --preset build-${{ matrix.platform }} | ||
cmake --build --preset install-${{ matrix.platform }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,8 @@ build*/ | |
|
||
# CMake build directories | ||
build*/ | ||
/build | ||
/out | ||
|
||
# Xcode | ||
xcode/Capstone.xcodeproj/xcuserdata | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "locations-base", | ||
"hidden": true, | ||
"binaryDir": "${sourceDir}/build/${presetName}", | ||
"installDir": "${sourceDir}/out/install/${presetName}" | ||
}, | ||
{ | ||
"name": "warnings-base", | ||
"hidden": true, | ||
"warnings": { | ||
"dev": true, | ||
"deprecated": true, | ||
"systemVars": true | ||
}, | ||
"errors": { | ||
"dev": true, | ||
"deprecated": false | ||
} | ||
}, | ||
{ | ||
"name": "ninja", | ||
"hidden": true, | ||
"displayName": "Ninja", | ||
"generator": "Ninja Multi-Config", | ||
"cacheVariables": { | ||
"CMAKE_DEFAULT_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "x64", | ||
"hidden": true, | ||
"architecture": { | ||
"value": "x64", | ||
"strategy": "external" | ||
} | ||
}, | ||
{ | ||
"name": "linux-x64", | ||
"inherits": [ "ninja", "x64", "locations-base", "warnings-base" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux"} | ||
}, | ||
{ | ||
"name": "macos-x64", | ||
"inherits": [ "ninja", "x64", "locations-base", "warnings-base" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin"} | ||
}, | ||
{ | ||
"name": "windows-x64", | ||
"inherits": [ "ninja", "x64", "locations-base", "warnings-base" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "build-linux", | ||
"configurePreset": "linux-x64", | ||
"nativeToolOptions": [ "-v" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux"} | ||
}, | ||
{ | ||
"name": "build-macos", | ||
"configurePreset": "macos-x64", | ||
"nativeToolOptions": [ "-v" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin"} | ||
}, | ||
{ | ||
"name": "build-windows", | ||
"configurePreset": "windows-x64", | ||
"nativeToolOptions": [ "-v" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} | ||
}, | ||
{ | ||
"name": "install-linux", | ||
"configurePreset": "linux-x64", | ||
"inherits": "build-linux", | ||
"targets": [ "install" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux"} | ||
}, | ||
{ | ||
"name": "install-macos", | ||
"configurePreset": "macos-x64", | ||
"inherits": "build-macos", | ||
"targets": [ "install" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin"} | ||
}, | ||
{ | ||
"name": "install-windows", | ||
"configurePreset": "windows-x64", | ||
"inherits": "build-windows", | ||
"targets": [ "install" ], | ||
"condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} | ||
} | ||
] | ||
} |