mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
chore(cmake): add CMake presets (#5655)
* chore(cmake): add CMake presets Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update .github/workflows/ci.yml * fix: don't autodetect `.venv` if inside a VIRTUALENV already Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update CMakeLists.txt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
80
CMakePresets.json
Normal file
80
CMakePresets.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"version": 6,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"displayName": "Default",
|
||||
"binaryDir": "build",
|
||||
"generator": "Ninja",
|
||||
"errors": {
|
||||
"dev": true,
|
||||
"deprecated": true
|
||||
},
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"PYBIND11_FINDPYTHON": "NEW",
|
||||
"PYBIND11_WERROR": true,
|
||||
"DOWNLOAD_CATCH": true,
|
||||
"DOWNLOAD_EIGEN": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "venv",
|
||||
"displayName": "Venv",
|
||||
"inherits": "default",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"PYBIND11_CREATE_WITH_UV": "python3",
|
||||
"Python_ROOT_DIR": ".venv",
|
||||
"PYBIND11_WERROR": true,
|
||||
"PYBIND11_FINDPYTHON": "NEW",
|
||||
"DOWNLOAD_CATCH": true,
|
||||
"DOWNLOAD_EIGEN": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"displayName": "Default Build",
|
||||
"configurePreset": "default"
|
||||
},
|
||||
{
|
||||
"name": "venv",
|
||||
"displayName": "Venv Build",
|
||||
"configurePreset": "venv"
|
||||
},
|
||||
{
|
||||
"name": "tests",
|
||||
"displayName": "Tests (for workflow)",
|
||||
"configurePreset": "default",
|
||||
"targets": ["pytest", "cpptest", "test_cmake_build"]
|
||||
},
|
||||
{
|
||||
"name": "testsvenv",
|
||||
"displayName": "Tests Venv (for workflow)",
|
||||
"configurePreset": "venv",
|
||||
"targets": ["pytest", "cpptest", "test_cmake_build"]
|
||||
}
|
||||
],
|
||||
"workflowPresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"displayName": "Default Workflow",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "default" },
|
||||
{ "type": "build", "name": "default" },
|
||||
{ "type": "build", "name": "tests" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "venv",
|
||||
"displayName": "Default Workflow",
|
||||
"steps": [
|
||||
{ "type": "configure", "name": "venv" },
|
||||
{ "type": "build", "name": "venv" },
|
||||
{ "type": "build", "name": "testsvenv" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user