Skip to content

Commit

Permalink
update CMake presets and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
foolnotion committed Aug 12, 2023
1 parent edc8c2e commit 5ab8c13
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 158 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ jobs:
python=${{ matrix.version }}
cache-environment: true

# Linux and macOS
# Linux (TODO: MacOS)
- name: Run Python
shell: bash -l {0}
run: |
export CC=clang
export CXX=clang++
bash script/dependencies.sh # install dependencies
python setup.py bdist_wheel # build the wheel
python setup.py bdist_wheel -- --preset build-linux # build the wheel
- name: 'Build wheel'
uses: actions/upload-artifact@v3
with:
name: pyoperon-wheel
path: dist/*.whl
retention-days: 7
retention-days: 90

nix-build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
Expand Down
245 changes: 90 additions & 155 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,157 +1,92 @@
{
"version": 1,
"cmakeMinimumRequired": {
"major": 3,
"minor": 14,
"patch": 0
},
"configurePresets": [
{
"name": "cmake-pedantic",
"hidden": true,
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true,
"unusedCli": true,
"systemVars": false
},
"errors": {
"dev": true,
"deprecated": true
}
},
{
"name": "dev-mode",
"hidden": true,
"inherits": "cmake-pedantic",
"cacheVariables": {
"pyoperon_DEVELOPER_MODE": "ON"
}
},
{
"name": "cppcheck",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr"
}
},
{
"name": "clang-tidy",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--header-filter=${sourceDir}/* -test/source/thirdparty/*"
}
},
{
"name": "ci-std",
"description": "This preset makes sure the project actually builds with at least the specified standard",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "17",
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
}
},
{
"name": "flags-unix",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic"
}
},
{
"name": "flags-windows",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/W4 /permissive- /utf-8 /volatile:iso /EHsc /Zc:__cplusplus /Zc:throwingNew"
}
},
{
"name": "ci-unix",
"generator": "Unix Makefiles",
"hidden": true,
"inherits": ["flags-unix", "ci-std"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ci-win64",
"inherits": ["flags-windows", "ci-std"],
"generator": "Visual Studio 16 2019",
"architecture": "x64",
"hidden": true
},
{
"name": "coverage-unix",
"binaryDir": "${sourceDir}/build/coverage",
"inherits": "ci-unix",
"hidden": true,
"cacheVariables": {
"ENABLE_COVERAGE": "ON",
"CMAKE_BUILD_TYPE": "Coverage",
"CMAKE_CXX_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions",
"CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage",
"CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage"
}
},
{
"name": "vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_OVERLAY_PORTS": "${sourceDir}/ports"
}
},
{
"name": "ci-coverage",
"inherits": ["coverage-unix", "dev-mode"],
"cacheVariables": {
"COVERAGE_HTML_COMMAND": ""
}
},
{
"name": "ci-sanitize",
"binaryDir": "${sourceDir}/build/sanitize",
"inherits": ["ci-unix", "dev-mode"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Sanitize",
"CMAKE_CXX_FLAGS_SANITIZE": "-O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common"
}
},
{
"name": "ci-build",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "ci-macos",
"inherits": ["ci-build", "ci-unix", "dev-mode"]
},
{
"name": "ci-ubuntu",
"inherits": ["ci-build", "ci-unix", "clang-tidy", "cppcheck", "dev-mode"]
},
{
"name": "ci-windows",
"inherits": ["ci-build", "ci-win64", "dev-mode"]
},
{
"name": "build-ubuntu",
"inherits": ["ci-build", "ci-unix"]
},
{
"name": "build-ubuntu-vcpkg",
"inherits": ["ci-build", "ci-unix", "vcpkg"]
},
{
"name": "build-windows",
"inherits": ["ci-build", "ci-win64"]
},
{
"name": "build-windows-vcpkg",
"inherits": ["ci-build", "ci-win64", "vcpkg"]
}
]
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"configurePresets": [
{
"name": "cmake-pedantic",
"hidden": true,
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true,
"unusedCli": true,
"systemVars": false
},
"errors": {
"dev": true,
"deprecated": true
}
},
{
"name": "dev-mode",
"hidden": true,
"inherits": "cmake-pedantic",
"cacheVariables": {
"pyoperon_DEVELOPER_MODE": "ON"
}
},
{
"name": "cppcheck",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr"
}
},
{
"name": "clang-tidy",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--header-filter=${sourceDir}/* -test/source/thirdparty/*"
}
},
{
"name": "cpp-std",
"description": "This preset makes sure the project actually builds with at least the specified standard",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "20",
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
}
},
{
"name": "cpp-build",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{CXX_WARNINGS} $env{CXX_OPT}",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "build-windows",
"hidden": false,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/W4 /permissive- /utf-8 /volatile:iso /EHsc /Zc:__cplusplus /Zc:throwingNew"
}
},
{
"name": "build-linux",
"generator": "Unix Makefiles",
"hidden": false,
"inherits": ["cpp-std", "cpp-build"],
"environment": {
"CXX_WARNINGS": "-Wall -Wextra -pedantic",
"CXX_OPT": "-fsized-deallocation -fno-math-errno -march=x86-64-v3"
}
},
{
"name": "build-osx",
"generator": "Unix Makefiles",
"hidden": false,
"inherits": ["cpp-std", "cpp-build"],
"environment": {
"CXX_WARNINGS": "-Wall -Wextra -pedantic",
"CXX_OPT": "-fsized-deallocation -fno-math-errno"
}
}
]
}

0 comments on commit 5ab8c13

Please sign in to comment.