Skip to content

Commit

Permalink
build: LLVM presets
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Nov 6, 2023
1 parent 9412a8c commit 2ac2157
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 0 deletions.
196 changes: 196 additions & 0 deletions third-party/llvm/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 10,
"patch": 0
},
"configurePresets": [
{
"name": "debug",
"displayName": "Debug-Base",
"description": "Debug Config.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LLVM_ENABLE_PROJECTS": "clang",
"LLVM_TARGETS_TO_BUILD": "X86",
"LLVM_UNREACHABLE_OPTIMIZE": false,
"LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION": false,
"LLVM_ENABLE_RTTI": true,
"LLVM_ENABLE_ASSERTIONS": true,
"LLVM_ENABLE_OCAMLDOC": false,
"LLVM_ENABLE_BINDINGS": false,
"LLVM_ENABLE_DIA_SDK": false,
"LLVM_INCLUDE_BENCHMARKS": false,
"LLVM_INCLUDE_DOCS": false,
"LLVM_INCLUDE_EXAMPLES": false,
"LLVM_INCLUDE_RUNTIMES": false,
"LLVM_INCLUDE_TESTS": false,
"LLVM_INCLUDE_TOOLS": true,
"LLVM_INCLUDE_UTILS": true,
"LLVM_BUILD_TOOLS": false,
"LLVM_BUILD_UTILS": false,
"LLVM_BUILD_RUNTIME": false,
"LLVM_BUILD_RUNTIMES": false,
"LLVM_BUILD_LLVM_C_DYLIB": false,
"LLVM_BUILD_TESTS": false,
"LLVM_BUILD_DOCS": false,
"LLVM_BUILD_EXAMPLES": false,
"CLANG_ENABLE_ARCMT": true,
"CLANG_ENABLE_HLSL": false,
"CLANG_ENABLE_OBJC_REWRITER": false,
"CLANG_ENABLE_PROTO_FUZZER": false,
"CLANG_ENABLE_STATIC_ANALYZER": true,
"CLANG_INCLUDE_TESTS": false,
"CLANG_INCLUDE_DOCS": false,
"CLANG_BUILD_EXAMPLES": false,
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}"
}
},
{
"name": "debwithopt",
"inherits": "debug",
"displayName": "DebWithOpt-Base",
"description": "Debug Config with Release Optimization",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "release",
"inherits": "debug",
"displayName": "Release-Base",
"description": "Release Config.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "relwithdebinfo",
"inherits": "release",
"displayName": "RelWithDebInfo-Base",
"description": "Release Config with Debug Info.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "debug-win",
"inherits": "debug",
"displayName": "Debug-Base-Win",
"description": "Debug Config without any extras and windows flags",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CONFIGURATION_TYPES": "Debug",
"CMAKE_C_FLAGS": "/DWIN32 /D_WINDOWS",
"CMAKE_CXX_FLAGS": "/DWIN32 /D_WINDOWS /EHsc",
"CMAKE_C_FLAGS_DEBUG": "/MDd /Zi /Ob0 /Od /RTC1",
"CMAKE_CXX_FLAGS_DEBUG": "/MDd /Zi /Ob0 /Od /RTC1",
"CMAKE_C_FLAGS_RELEASE": "/MD /O2 /Ob2 /DNDEBUG",
"CMAKE_CXX_FLAGS_RELEASE": "/MD /O2 /Ob2 /DNDEBUG",
"CMAKE_C_FLAGS_MINSIZEREL": "/MD /O1 /Ob1 /DNDEBUG",
"CMAKE_CXX_FLAGS_MINSIZEREL": "/MD /O1 /Ob1 /DNDEBUG",
"CMAKE_C_FLAGS_RELWITHDEBINFO": "/MD /Zi /O2 /Ob1",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/MD /Zi /O2 /Ob1"
}
},
{
"name": "debwithopt-win",
"inherits": [
"debug-win",
"debwithopt"
],
"displayName": "DebWithOptde-Base-Win",
"description": "Debug Config with Release Optimization",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CONFIGURATION_TYPES": "Debug",
"CMAKE_C_FLAGS": "/DWIN32 /D_WINDOWS /Ob1 /O2 /Zi",
"CMAKE_CXX_FLAGS": "/DWIN32 /D_WINDOWS /Ob1 /O2 /Zi",
"CMAKE_C_FLAGS_DEBUG": "/Ob1 /O2 /Zi",
"CMAKE_CXX_FLAGS_DEBUG": "/Ob1 /O2 /Zi"
}
},
{
"name": "release-win",
"inherits": [
"debug-win",
"release"
],
"displayName": "Release-Base-Win",
"description": "Release Config.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CONFIGURATION_TYPES": "Release"
}
},
{
"name": "relwithdebinfo-win",
"inherits": "release",
"displayName": "RelWithDebInfo-Base-Unix",
"description": "Release Config with Debug Info.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CONFIGURATION_TYPES": "RelWithDebInfo"
}
},
{
"name": "debug-unix",
"inherits": "debug",
"displayName": "Debug-Base-Unix",
"description": "Debug Config without any extras and windows flags",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "debwithopt-unix",
"inherits": [
"debug-unix",
"debwithopt"
],
"displayName": "DebWithOpt-Base-Unix",
"description": "Debug Config with Release Optimization",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_FLAGS": "-Og -g",
"CMAKE_CXX_FLAGS": "-Og -g",
"CMAKE_C_FLAGS_DEBUG": "-Og -g",
"CMAKE_CXX_FLAGS_DEBUG": "-Og -g"
}
},
{
"name": "release-unix",
"inherits": [
"debug-unix",
"release"
],
"displayName": "Release-Base-Unix",
"description": "Release Config.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "relwithdebinfo-unix",
"inherits": "release",
"displayName": "RelWithDebInfo-Base-Unix",
"description": "Release Config with Debug Info.",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
}
]
}
103 changes: 103 additions & 0 deletions third-party/llvm/CMakeUserPresets.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"version": 3,
"configurePresets": [
{
"name": "debug-msvc",
"inherits": "debug-win",
"binaryDir": "${sourceDir}/build/MSVC/Debug",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/MSVC/Debug"
}
},
{
"name": "debwithopt-msvc",
"inherits": "debwithopt-win",
"binaryDir": "${sourceDir}/build/MSVC/DebWithOpt",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/MSVC/DebWithOpt"
},
"architecture": {
"value": "x64",
"strategy": "external"
}
},
{
"name": "release-msvc",
"inherits": "release-win",
"binaryDir": "${sourceDir}/build/MSVC/Release",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/MSVC/Release"
},
"architecture": {
"value": "x64",
"strategy": "external"
}
},
{
"name": "relwithdebinfo-msvc",
"inherits": "relwithdebinfo-win",
"binaryDir": "${sourceDir}/build/MSVC/RelWithDebInfo",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/MSVC/RelWithDebInfo"
},
"architecture": {
"value": "x64",
"strategy": "external"
}
},
{
"name": "debug-linux",
"inherits": "debug-unix",
"binaryDir": "${sourceDir}/build/Linux/Debug",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/Linux/Debug",
"CMAKE_CXX_COMPILER": "/usr/bin/g++-13",
"CMAKE_C_COMPILER": "/usr/bin/gcc-13"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
],
"intelliSenseMode": "windows-msvc-x64"
},
"jetbrains.com/clion": {
"toolchain": "WSL GCC"
}
}
},
{
"name": "debwithopt-linux",
"inherits": [
"debwithopt-unix",
"debug-linux"
],
"binaryDir": "${sourceDir}/build/Linux/DebWithOpt",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/Linux/DebWithOpt"
}
},
{
"name": "release-linux",
"inherits": [
"release-unix",
"debug-linux"
],
"binaryDir": "${sourceDir}/build/Linux/Release",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/Linux/Release"
}
},
{
"name": "relwithdebinfo-linux",
"inherits": [
"relwithdebinfo-unix",
"debug-linux"
],
"binaryDir": "${sourceDir}/build/Linux/RelWithDebInfo",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/Linux/RelWithDebInfo"
}
}
]
}

0 comments on commit 2ac2157

Please sign in to comment.