-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: modernize build system (#175)
* update workflow * use v9 * refactor: modernize build system - Modernize CMake configuration using CMakePresets.json - Integrate vcpkg package management as submodule - Switch to Visual Studio 2022 generator for Windows builds - Simplify and standardize build presets across platforms - Clean up GitHub Actions workflow configuration This change modernizes the build system with better cross-platform support. It introduces vcpkg for package management and uses CMakePresets.json for a more standardized build configuration approach. --------- Co-authored-by: Wang Fenjin <wangfenj@gmail.com>
- Loading branch information
1 parent
282cb35
commit 8a58619
Showing
4 changed files
with
223 additions
and
67 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
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,3 @@ | ||
[submodule "vcpkg"] | ||
path = vcpkg | ||
url = https://github.com/Microsoft/vcpkg.git |
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,137 @@ | ||
{ | ||
"version": 8, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 21, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "ninja-vcpkg", | ||
"displayName": "Ninja", | ||
"description": "Configure with vcpkg toolchain", | ||
"binaryDir": "${sourceDir}/build", | ||
"generator": "Ninja", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": { | ||
"type": "FILEPATH", | ||
"value": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "ninja-vcpkg-coverage", | ||
"inherits": "ninja-vcpkg", | ||
"displayName": "Ninja Coverage", | ||
"description": "Configure with code coverage enabled", | ||
"cacheVariables": { | ||
"CODE_COVERAGE": { | ||
"type": "BOOL", | ||
"value": "ON" | ||
}, | ||
"BUILD_TESTING": { | ||
"type": "BOOL", | ||
"value": "OFF" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "ninja-vcpkg-release", | ||
"inherits": "ninja-vcpkg", | ||
"displayName": "Ninja Release", | ||
"description": "Configure for release without tests", | ||
"cacheVariables": { | ||
"CODE_COVERAGE": { | ||
"type": "BOOL", | ||
"value": "OFF" | ||
}, | ||
"BUILD_SHELL": { | ||
"type": "BOOL", | ||
"value": "OFF" | ||
}, | ||
"BUILD_TEST_EXAMPLE": { | ||
"type": "BOOL", | ||
"value": "OFF" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "macos-ninja", | ||
"displayName": "macOS Ninja", | ||
"description": "Configure for macOS build", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/../../_temp/macos", | ||
"cacheVariables": { | ||
"CMAKE_INSTALL_PREFIX": { | ||
"type": "PATH", | ||
"value": "${sourceDir}/../../_temp/macos/install" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "windows-msvc-vs17", | ||
"displayName": "Visual Studio 17 2022", | ||
"description": "Configure with VS17 and vcpkg toolchain", | ||
"generator": "Visual Studio 17 2022", | ||
"architecture": "x64", | ||
"toolset": "v143", | ||
"binaryDir": "${sourceDir}/../../_temp/windows", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": { | ||
"type": "FILEPATH", | ||
"value": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
}, | ||
"BUILD_TESTING": { | ||
"type": "BOOL", | ||
"value": "OFF" | ||
} | ||
}, | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Windows" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "ninja-vcpkg-release", | ||
"configurePreset": "ninja-vcpkg", | ||
"displayName": "Build Release", | ||
"description": "Build release version", | ||
"configuration": "Release" | ||
}, | ||
{ | ||
"name": "ninja-vcpkg-coverage", | ||
"configurePreset": "ninja-vcpkg-coverage", | ||
"displayName": "Build Coverage", | ||
"description": "Build with coverage enabled" | ||
}, | ||
{ | ||
"name": "macos-ninja", | ||
"configurePreset": "macos-ninja", | ||
"displayName": "Build macOS", | ||
"description": "Build for macOS" | ||
}, | ||
{ | ||
"name": "macos-ninja-release", | ||
"configurePreset": "macos-ninja", | ||
"displayName": "Build macOS (Release)", | ||
"description": "Build for macOS (Release)", | ||
"configuration": "Release" | ||
}, | ||
{ | ||
"name": "windows-msvc-vs17", | ||
"configurePreset": "windows-msvc-vs17", | ||
"displayName": "Build Windows VS17", | ||
"description": "Build with VS17" | ||
}, | ||
{ | ||
"name": "windows-msvc-vs17-release", | ||
"configurePreset": "windows-msvc-vs17", | ||
"displayName": "Build Windows VS17 (Release)", | ||
"description": "Build with VS17 (Release)", | ||
"configuration": "Release" | ||
} | ||
] | ||
} |