cmake: Changed the preset names, made clang always use lld, and added a new lto preset.

This commit is contained in:
arcum42 2023-01-03 17:37:32 -08:00
parent 4921afdb51
commit 3254d27fc2
1 changed files with 48 additions and 37 deletions

View File

@ -7,85 +7,99 @@
}, },
"configurePresets": [ "configurePresets": [
{ {
"name": "defaults", "name": "gcc-base",
"displayName": "Defaults", "displayName": "GCC Base",
"description": "Base preset. Only for inheriting from.", "description": "Base preset for GCC. Only for inheriting from.",
"hidden": true, "hidden": true,
"binaryDir": "${sourceDir}/build" "binaryDir": "${sourceDir}/build"
}, },
{ {
"name": "clang", "name": "clang-base",
"displayName": "Clang", "displayName": "Base",
"description": "Base clang preset. Only for inheriting from.", "description": "Base preset for Clang. Only for inheriting from.",
"hidden": true, "hidden": true,
"inherits": "defaults", "binaryDir": "${sourceDir}/build",
"generator": "Ninja",
"cacheVariables": { "cacheVariables": {
"CMAKE_EXE_LINKER_FLAGS_INIT": "-fuse-ld=lld",
"CMAKE_MODULE_LINKER_FLAGS_INIT": "-fuse-ld=lld",
"CMAKE_SHARED_LINKER_FLAGS_INIT": "-fuse-ld=lld",
"CMAKE_C_COMPILER": "clang", "CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++" "CMAKE_CXX_COMPILER": "clang++"
} }
}, },
{
"name": "lto",
"displayName": "Default Profile using clang/ninja & lto.",
"description": "Release lto build using ninja & clang.",
"inherits": "clang-base",
"cacheVariables": {
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
},
{ {
"name": "ninja-multi", "name": "ninja-multi",
"displayName": "Ninja Multi Config", "displayName": "Ninja Multi Config",
"description": "Generate multiple ninja build files.", "description": "Generate multiple ninja build files.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Ninja Multi-Config" "generator": "Ninja Multi-Config"
}, },
{ {
"name": "debug", "name": "gcc-debug",
"displayName": "Debug", "displayName": "GCC Debug",
"description": "Debug build with make.", "description": "GCC Debug build with make.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Unix Makefiles", "generator": "Unix Makefiles",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug" "CMAKE_BUILD_TYPE": "Debug"
} }
}, },
{ {
"name": "devel", "name": "gcc-devel",
"displayName": "Devel", "displayName": "GCC Devel",
"description": "Developer build using make.", "description": "GCC Developer build using make.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Unix Makefiles", "generator": "Unix Makefiles",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Devel" "CMAKE_BUILD_TYPE": "Devel"
} }
}, },
{ {
"name": "release", "name": "gcc-release",
"displayName": "Release", "displayName": "GCC Release",
"description": "Release build using make.", "description": "GCC Release build using make.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Unix Makefiles", "generator": "Unix Makefiles",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release" "CMAKE_BUILD_TYPE": "Release"
} }
}, },
{ {
"name": "debug-ninja", "name": "gcc-debug-ninja",
"displayName": "Debug Ninja", "displayName": "GCC Debug Ninja",
"description": "Debug build using ninja.", "description": "Debug build using ninja.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Ninja", "generator": "Ninja",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug" "CMAKE_BUILD_TYPE": "Debug"
} }
}, },
{ {
"name": "devel-ninja", "name": "gcc-devel-ninja",
"displayName": "Devel Ninja", "displayName": "GCC Devel Ninja",
"description": "Developer build using ninja.", "description": "GCC Developer build using ninja.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Ninja", "generator": "Ninja",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Devel" "CMAKE_BUILD_TYPE": "Devel"
} }
}, },
{ {
"name": "release-ninja", "name": "gcc-release-ninja",
"displayName": "Release Ninja", "displayName": "GCC Release Ninja",
"description": "Release build using ninja.", "description": "GCC Release build using ninja.",
"inherits": "defaults", "inherits": "gcc-base",
"generator": "Ninja", "generator": "Ninja",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release" "CMAKE_BUILD_TYPE": "Release"
@ -95,8 +109,7 @@
"name": "clang-debug", "name": "clang-debug",
"displayName": "Clang Debug", "displayName": "Clang Debug",
"description": "Debug build using ninja and clang.", "description": "Debug build using ninja and clang.",
"generator": "Ninja", "inherits": "clang-base",
"inherits": "clang",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug" "CMAKE_BUILD_TYPE": "Debug"
} }
@ -105,8 +118,7 @@
"name": "clang-devel", "name": "clang-devel",
"displayName": "Clang Devel", "displayName": "Clang Devel",
"description": "Developer build using ninja & clang.", "description": "Developer build using ninja & clang.",
"generator": "Ninja", "inherits": "clang-base",
"inherits": "clang",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Devel" "CMAKE_BUILD_TYPE": "Devel"
} }
@ -115,8 +127,7 @@
"name": "clang-release", "name": "clang-release",
"displayName": "Clang Release", "displayName": "Clang Release",
"description": "Release build using ninja & clang.", "description": "Release build using ninja & clang.",
"generator": "Ninja", "inherits": "clang-base",
"inherits": "clang",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release" "CMAKE_BUILD_TYPE": "Release"
} }