Skip to content

Commit 35f7d38

Browse files
committed
Add build presets for macOS ARM configurations in CMakePresets.json
1 parent 40f100f commit 35f7d38

File tree

1 file changed

+95
-75
lines changed

1 file changed

+95
-75
lines changed

CMakePresets.json

Lines changed: 95 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,97 @@
11
{
2-
"version": 3,
3-
"configurePresets": [
4-
{
5-
"name": "base",
6-
"hidden": true,
7-
"cacheVariables": {
8-
"CMAKE_TOOLCHAIN_FILE": {
9-
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
10-
"type": "FILEPATH"
11-
},
12-
"CMAKE_EXPORT_COMPILE_COMMANDS": {
13-
"value": "YES",
14-
"type": "BOOL"
15-
},
16-
"CMAKE_C_COMPILER": "clang",
17-
"CMAKE_CXX_COMPILER": "clang++",
18-
"ENABLE_CLANG_TIDY": {
19-
"value": "ON",
20-
"type": "BOOL"
21-
}
22-
},
23-
"binaryDir": "${sourceDir}/build"
24-
},
25-
{
26-
"name": "macos-arm-base",
27-
"hidden": true,
28-
"inherits": "base",
29-
"description": "Preset for ARM macOS",
30-
"cacheVariables": {
31-
"CMAKE_SYSTEM_NAME": "Darwin",
32-
"VCPKG_TARGET_TRIPLET": "arm64-osx"
33-
}
34-
},
35-
{
36-
"name": "linux-x64",
37-
"inherits": "base",
38-
"description": "Preset for x64 Linux",
39-
"cacheVariables": {
40-
"CMAKE_SYSTEM_NAME": "Linux",
41-
"VCPKG_TARGET_TRIPLET": "x64-linux",
42-
"ENABLE_CLANG_TIDY": {
43-
"value": "OFF",
44-
"type": "BOOL"
45-
}
46-
}
47-
},
48-
{
49-
"name": "linux-x64-release",
50-
"inherits": "linux-x64",
51-
"description": "Release preset for x64 Linux",
52-
"cacheVariables": {
53-
"CMAKE_BUILD_TYPE": "Release",
54-
"CMAKE_CXX_FLAGS_RELEASE": "-O3 -DNDEBUG -march=native",
55-
"CMAKE_C_FLAGS_RELEASE": "-O3"
56-
}
57-
},
58-
{
59-
"name": "macos-arm-release",
60-
"inherits": "macos-arm-base",
61-
"description": "Release preset for ARM macOS",
62-
"cacheVariables": {
63-
"CMAKE_BUILD_TYPE": "Release",
64-
"CMAKE_CXX_FLAGS_RELEASE": "-O3 -DNDEBUG -march=native",
65-
"CMAKE_C_FLAGS_RELEASE": "-O3"
66-
}
67-
},
68-
{
69-
"name": "macos-arm-debug",
70-
"inherits": "macos-arm-base",
71-
"description": "Debug preset for ARM macOS",
72-
"cacheVariables": {
73-
"CMAKE_BUILD_TYPE": "Debug"
74-
}
75-
}
76-
]
2+
"version": 3,
3+
"configurePresets": [
4+
{
5+
"name": "base",
6+
"hidden": true,
7+
"cacheVariables": {
8+
"CMAKE_TOOLCHAIN_FILE": {
9+
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
10+
"type": "FILEPATH"
11+
},
12+
"CMAKE_EXPORT_COMPILE_COMMANDS": {
13+
"value": "YES",
14+
"type": "BOOL"
15+
},
16+
"CMAKE_C_COMPILER": "clang",
17+
"CMAKE_CXX_COMPILER": "clang++",
18+
"ENABLE_CLANG_TIDY": {
19+
"value": "ON",
20+
"type": "BOOL"
21+
}
22+
},
23+
"binaryDir": "${sourceDir}/build"
24+
},
25+
{
26+
"name": "macos-arm-base",
27+
"hidden": true,
28+
"inherits": "base",
29+
"description": "Preset for ARM macOS",
30+
"cacheVariables": {
31+
"CMAKE_SYSTEM_NAME": "Darwin",
32+
"VCPKG_TARGET_TRIPLET": "arm64-osx"
33+
}
34+
},
35+
{
36+
"name": "linux-x64",
37+
"inherits": "base",
38+
"description": "Preset for x64 Linux",
39+
"cacheVariables": {
40+
"CMAKE_SYSTEM_NAME": "Linux",
41+
"VCPKG_TARGET_TRIPLET": "x64-linux",
42+
"ENABLE_CLANG_TIDY": {
43+
"value": "OFF",
44+
"type": "BOOL"
45+
}
46+
}
47+
},
48+
{
49+
"name": "linux-x64-release",
50+
"inherits": "linux-x64",
51+
"description": "Release preset for x64 Linux",
52+
"cacheVariables": {
53+
"CMAKE_BUILD_TYPE": "Release",
54+
"CMAKE_CXX_FLAGS_RELEASE": "-O3 -DNDEBUG -march=native",
55+
"CMAKE_C_FLAGS_RELEASE": "-O3"
56+
}
57+
},
58+
{
59+
"name": "macos-arm-release",
60+
"inherits": "macos-arm-base",
61+
"description": "Release preset for ARM macOS",
62+
"cacheVariables": {
63+
"CMAKE_BUILD_TYPE": "Release",
64+
"CMAKE_CXX_FLAGS_RELEASE": "-O3 -DNDEBUG -march=native",
65+
"CMAKE_C_FLAGS_RELEASE": "-O3"
66+
}
67+
},
68+
{
69+
"name": "macos-arm-debug",
70+
"inherits": "macos-arm-base",
71+
"description": "Debug preset for ARM macOS",
72+
"cacheVariables": {
73+
"CMAKE_BUILD_TYPE": "Debug"
74+
}
75+
}
76+
],
77+
"buildPresets": [
78+
{
79+
"name": "macos-arm-release",
80+
"configurePreset": "macos-arm-release",
81+
"configuration": "Release",
82+
"jobs": 0,
83+
"targets": [
84+
"all"
85+
]
86+
},
87+
{
88+
"name": "macos-arm-debug",
89+
"configurePreset": "macos-arm-debug",
90+
"configuration": "Debug",
91+
"jobs": 0,
92+
"targets": [
93+
"all"
94+
]
95+
}
96+
]
7797
}

0 commit comments

Comments
 (0)