Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMakePresets #11

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 27,
"patch": 0
},
"include": [
"cmake/presets/os-linux.json",
"cmake/presets/os-macos.json",
"cmake/presets/os-windows.json"
]
}
23 changes: 0 additions & 23 deletions autogen.sh

This file was deleted.

18 changes: 18 additions & 0 deletions cmake/presets/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 6,
"configurePresets": [
{ "name": "debug", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "release", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
{ "name": "arch-native", "hidden": true, "cacheVariables": { "CMAKE_CXX_FLAGS": "-march=native" } },
{ "name": "clang", "hidden": true, "cacheVariables": { "CMAKE_CXX_COMPILER": "clang++" } },
{ "name": "gcc", "hidden": true, "cacheVariables": { "CMAKE_CXX_COMPILER": "g++" } },
{
"name": "libunicode-common",
"hidden": true,
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"PEDANTIC_COMPILER": "ON"
}
}
]
}
61 changes: 61 additions & 0 deletions cmake/presets/os-linux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"version": 6,
"include": [ "common.json" ],
"configurePresets": [
{
"name": "linux-common",
"inherits": "libunicode-common",
"generator": "Ninja",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "linux-clang-debug",
"displayName": "Linux (Clang) Debug",
"inherits": ["linux-common", "debug", "clang"]
},
{
"name": "linux-clang-release",
"displayName": "Linux (Clang) Release",
"inherits": ["linux-common", "release", "clang"]
},
{
"name": "linux-gcc-debug",
"displayName": "Linux (GCC) Debug",
"inherits": ["linux-common", "debug", "gcc"]
},
{
"name": "linux-gcc-release",
"displayName": "Linux (GCC) Release",
"inherits": ["linux-common", "release", "gcc"]
},
{
"name": "linux-native-clang-release",
"displayName": "Linux (Clang, Native arch, Release)",
"inherits": ["linux-common", "release", "arch-native", "clang"]
},
{
"name": "linux-native-gcc-release",
"displayName": "Linux (GCC, Native arch, Release)",
"inherits": ["linux-common", "release", "arch-native", "gcc"]
}
],
"buildPresets": [
{ "name": "linux-clang-debug", "configurePreset": "linux-clang-debug" },
{ "name": "linux-clang-release", "configurePreset": "linux-clang-release" },
{ "name": "linux-gcc-debug", "configurePreset": "linux-gcc-debug" },
{ "name": "linux-gcc-release", "configurePreset": "linux-gcc-release" },
{ "name": "linux-native-clang-release", "configurePreset": "linux-native-clang-release" },
{ "name": "linux-native-gcc-release", "configurePreset": "linux-native-gcc-release" }
],
"testPresets": [
{ "name": "linux-clang-debug", "configurePreset": "linux-clang-debug", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } },
{ "name": "linux-clang-release", "configurePreset": "linux-clang-release", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } },
{ "name": "linux-gcc-debug", "configurePreset": "linux-gcc-debug", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } },
{ "name": "linux-gcc-release", "configurePreset": "linux-gcc-release", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } }
]
}
27 changes: 27 additions & 0 deletions cmake/presets/os-macos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": 6,
"include": [ "common.json" ],
"configurePresets": [
{
"name": "macos-common",
"inherits": "libunicode-common",
"generator": "Ninja",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{ "name": "macos-debug", "displayName": "MacOS Debug", "inherits": ["macos-common", "debug"] },
{ "name": "macos-release", "displayName": "MacOS Release", "inherits": ["macos-common", "release"] }
],
"buildPresets": [
{ "name": "macos-debug", "configurePreset": "macos-debug" },
{ "name": "macos-release", "configurePreset": "macos-release" }
],
"testPresets": [
{ "name": "macos-debug", "configurePreset": "macos-debug", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } },
{ "name": "macos-release", "configurePreset": "macos-release", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } }
]
}
39 changes: 39 additions & 0 deletions cmake/presets/os-windows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": 6,
"include": [ "common.json" ],
"configurePresets": [
{
"name": "windows-common",
"inherits": "libunicode-common",
"displayName": "Windows - common settings",
"hidden": true,
"binaryDir": "${sourceDir}/out/build/${presetName}",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_VERBOSE_MAKEFILE": "ON",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake"
}
},
{ "name": "windows-cl-debug", "inherits": ["windows-common", "debug"], "displayName": "Windows (MSVC) Debug", "description": "Using MSVC compiler (64-bit)" },
{ "name": "windows-cl-release", "inherits": ["windows-common", "release"], "displayName": "Windows (MSVC) Release", "description": "Using MSVC compiler (64-bit)" },
{ "name": "windows-clang-common", "inherits": ["windows-common"], "hidden": true, "toolset": "ClangCL,host=x64" },
{ "name": "windows-clang-debug", "inherits": ["windows-clang-common", "debug"], "displayName": "Windows (ClangCL) Debug", "description": "Using Clang compiler (64-bit)" },
{ "name": "windows-clang-release", "inherits": ["windows-clang-common", "release"], "displayName": "Windows (ClangCL) Release", "description": "Using Clang compiler (64-bit)" }
],
"buildPresets": [
{ "name": "windows-cl-debug", "displayName": "x64 (MSVC) Debug", "configurePreset": "windows-cl-debug", "configuration": "Debug" },
{ "name": "windows-cl-release", "displayName": "x64 (MSVC) RelWithDebInfo", "configurePreset": "windows-cl-release", "configuration": "RelWithDebInfo" },
{ "name": "windows-clang-debug", "displayName": "x64 (Clang) Debug", "configurePreset": "windows-clang-debug", "configuration": "Debug" },
{ "name": "windows-clang-release", "displayName": "x64 (Clang) RelWithDebInfo", "configurePreset": "windows-clang-release", "configuration": "RelWithDebInfo" }
],
"testPresets": [
{ "name": "windows-cl-debug", "configurePreset": "windows-cl-debug", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } },
{ "name": "windows-cl-release", "configurePreset": "windows-cl-release", "output": {"outputOnFailure": true}, "execution": { "noTestsAction": "error", "stopOnFailure": true } }
]
}
Loading