Skip to content

Commit ba63ed0

Browse files
committed
build: support CMake presets
1 parent 2584328 commit ba63ed0

File tree

4 files changed

+159
-37
lines changed

4 files changed

+159
-37
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/.idea
22
/.vs
33
/.vscode
4-
/CMakePresets.json
4+
/CMakeUserPresets.json
55
/CMakeSettings.json
66
/build
77
/local

CMakePresets.json

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"version": 5,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 10,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "Debug",
11+
"displayName": "Debug-Base",
12+
"description": "Debug Config including tests.",
13+
"binaryDir": "${sourceDir}/build/debug",
14+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
15+
"cacheVariables": {
16+
"CMAKE_BUILD_TYPE": "Debug",
17+
"CMAKE_CXX_STANDARD": "20",
18+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
19+
"LLVM_ROOT": "$env{LLVM_ROOT}",
20+
"Clang_ROOT": "$env{LLVM_ROOT}",
21+
"DUKTAPE_SOURCE_ROOT": "$env{DUKTAPE_SOURCE_ROOT}",
22+
"MRDOX_BUILD_TESTS": "ON"
23+
},
24+
"vendor": {
25+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
26+
"hostOS": [ "Linux", "macOS" ],
27+
"intelliSenseMode": "windows-msvc-x64"
28+
}
29+
}
30+
},
31+
{
32+
"name": "Release",
33+
"inherits": "Debug",
34+
"displayName": "Release-Base",
35+
"description": "Release Config including tests.",
36+
"binaryDir": "${sourceDir}/build/release",
37+
"cacheVariables": {
38+
"CMAKE_BUILD_TYPE": "Release"
39+
}
40+
},
41+
{
42+
"name": "RelWithDebInfo",
43+
"inherits": "Release",
44+
"displayName": "RelWithDebInfo-Base",
45+
"description": "RelWithDebInfo Config including tests.",
46+
"binaryDir": "${sourceDir}/build/relwithdebinfo",
47+
"cacheVariables": {
48+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
49+
}
50+
},
51+
{
52+
"name": "Dist",
53+
"inherits": "Release",
54+
"displayName": "Distribution-Base",
55+
"description": "Release Config without Tests.",
56+
"binaryDir": "${sourceDir}/build/dist",
57+
"cacheVariables": {
58+
"MRDOX_BUILD_TESTS": "OFF"
59+
}
60+
}
61+
]
62+
}

CMakeSettings.json.example

-36
This file was deleted.

CMakeUserPresets.json.example

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"version": 5,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 10,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "Debug-MSVC",
11+
"inherits": "Debug",
12+
"generator": "Visual Studio 17 2022",
13+
"architecture": "x64",
14+
"binaryDir": "${sourceDir}/build/debug-msvc",
15+
"toolchainFile": "C:\\source\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake",
16+
"cacheVariables": {
17+
"LLVM_ROOT": "C:\\source\\llvm+clang\\Debug",
18+
"Clang_ROOT": "C:\\source\\llvm+clang\\Debug",
19+
"DUKTAPE_SOURCE_ROOT": "C:\\source\\duktape-2.7.0"
20+
},
21+
"condition": {
22+
"type": "equals",
23+
"lhs": "${hostSystemName}",
24+
"rhs": "Windows"
25+
},
26+
"vendor": {
27+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
28+
"hostOS": [ "Windows" ],
29+
"intelliSenseMode": "windows-msvc-x64"
30+
}
31+
}
32+
},
33+
{
34+
"name": "DebWithOpt-MSVC",
35+
"inherits": "Debug-MSVC",
36+
"binaryDir": "${sourceDir}/build/debwithopt-msvc",
37+
"cacheVariables": {
38+
"LLVM_ROOT": "C:\\source\\llvm+clang\\DebWithOpt",
39+
"Clang_ROOT": "C:\\source\\llvm+clang\\DebWithOpt"
40+
}
41+
},
42+
{
43+
"name": "Release-MSVC",
44+
"inherits": "Debug-MSVC",
45+
"binaryDir": "${sourceDir}/build/release-msvc",
46+
"cacheVariables": {
47+
"CMAKE_BUILD_TYPE": "Release",
48+
"LLVM_ROOT": "C:\\source\\llvm+clang\\Release",
49+
"Clang_ROOT": "C:\\source\\llvm+clang\\Release"
50+
}
51+
},
52+
{
53+
"name": "RelWithDebInfo-MSVC",
54+
"inherits": "Debug-MSVC",
55+
"binaryDir": "${sourceDir}/build/relwithdebinfo-msvc",
56+
"cacheVariables": {
57+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
58+
"LLVM_ROOT": "C:\\source\\llvm+clang\\RelWithDebInfo",
59+
"Clang_ROOT": "C:\\source\\llvm+clang\\RelWithDebInfo"
60+
}
61+
},
62+
{
63+
"name": "Debug-GCC",
64+
"inherits": "Debug",
65+
"binaryDir": "${sourceDir}/build/debug-gcc",
66+
"toolchainFile": "/home/$env{USER}/vcpkg/scripts/buildsystems/vcpkg.cmake",
67+
"cacheVariables": {
68+
"CMAKE_CXX_COMPILER": "g++",
69+
"CMAKE_C_COMPILER": "gcc",
70+
"LLVM_ROOT": "/usr/local/llvm+clang",
71+
"Clang_ROOT": "/usr/local/llvm+clang",
72+
"DUKTAPE_SOURCE_ROOT": "/home/$env{USER}/source/duktape/duktape-2.7.0"
73+
},
74+
"condition": {
75+
"type": "notEquals",
76+
"lhs": "${hostSystemName}",
77+
"rhs": "Windows"
78+
},
79+
"vendor": {
80+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
81+
"hostOS": ["Linux"],
82+
"intelliSenseMode": "windows-msvc-x64"
83+
}
84+
}
85+
},
86+
{
87+
"name": "Debug-Clang",
88+
"inherits": "Debug-GCC",
89+
"binaryDir": "${sourceDir}/build/debug-clang",
90+
"cacheVariables": {
91+
"CMAKE_CXX_COMPILER": "clang++",
92+
"CMAKE_C_COMPILER": "clang"
93+
}
94+
}
95+
]
96+
}

0 commit comments

Comments
 (0)