add RelWithDebInfo presets and move -Werror flag into presets.json

This commit is contained in:
jadebenn 2024-04-13 17:48:58 -05:00
parent b96cfd71a4
commit 6ccd72c6a9
3 changed files with 177 additions and 3 deletions

View File

@ -255,9 +255,9 @@ endif()
if(MSVC) if(MSVC)
add_compile_options("/W4") add_compile_options("/W4")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options("-Wuninitialized" "-Wold-style-cast" "-Werror") add_compile_options("-Wuninitialized" "-Wold-style-cast")
else() else()
message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' No warning flags enabled.") message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' - No warning flags enabled.")
endif() endif()
# Add linking directories: # Add linking directories:

View File

@ -20,6 +20,13 @@
"CMAKE_BUILD_TYPE": "Debug" "CMAKE_BUILD_TYPE": "Debug"
} }
}, },
{
"name": "relwithdebinfo-config",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{ {
"name": "release-config", "name": "release-config",
"hidden": true, "hidden": true,
@ -75,6 +82,9 @@
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
"rhs": "Linux" "rhs": "Linux"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS_INIT": "-Werror"
} }
}, },
{ {
@ -88,6 +98,17 @@
"description": "Create a debug build using the Clang toolchain for Linux", "description": "Create a debug build using the Clang toolchain for Linux",
"binaryDir": "${sourceDir}/build/clang-debug" "binaryDir": "${sourceDir}/build/clang-debug"
}, },
{
"name": "linux-clang-relwithdebinfo",
"inherits": [
"linux-config",
"clang-config",
"relwithdebinfo-config"
],
"displayName": "[RelWithDebInfo] Linux (Clang)",
"description": "Create a release build with debug info using the Clang toolchain for Linux",
"binaryDir": "${sourceDir}/build/clang-relwithdebinfo"
},
{ {
"name": "linux-clang-release", "name": "linux-clang-release",
"inherits": [ "inherits": [
@ -110,6 +131,17 @@
"description": "Create a debug build using the GNU toolchain for Linux", "description": "Create a debug build using the GNU toolchain for Linux",
"binaryDir": "${sourceDir}/build/gnu-debug" "binaryDir": "${sourceDir}/build/gnu-debug"
}, },
{
"name": "linux-gnu-relwithdebinfo",
"inherits": [
"linux-config",
"gnu-config",
"relwithdebinfo-config"
],
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "Create a release build with debug info using the GNU toolchain for Linux",
"binaryDir": "${sourceDir}/build/gnu-relwithdebinfo"
},
{ {
"name": "linux-gnu-release", "name": "linux-gnu-release",
"inherits": [ "inherits": [
@ -150,6 +182,14 @@
"configuration": "Debug", "configuration": "Debug",
"jobs": 2 "jobs": 2
}, },
{
"name": "windows-msvc-relwithdebinfo",
"configurePreset": "windows-msvc",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "This preset is used to build in debug mode using the MSVC toolchain on Windows",
"configuration": "RelWithDebInfo",
"jobs": 2
},
{ {
"name": "windows-msvc-release", "name": "windows-msvc-release",
"configurePreset": "windows-msvc", "configurePreset": "windows-msvc",
@ -166,6 +206,14 @@
"configuration": "Debug", "configuration": "Debug",
"jobs": 2 "jobs": 2
}, },
{
"name": "linux-clang-relwithdebinfo",
"configurePreset": "linux-clang-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (Clang)",
"description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux",
"configuration": "RelWithDebInfo",
"jobs": 2
},
{ {
"name": "linux-clang-release", "name": "linux-clang-release",
"configurePreset": "linux-clang-release", "configurePreset": "linux-clang-release",
@ -182,6 +230,14 @@
"configuration": "Debug", "configuration": "Debug",
"jobs": 2 "jobs": 2
}, },
{
"name": "linux-gnu-relwithdebinfo",
"configurePreset": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux",
"configuration": "RelWithDebInfo",
"jobs": 2
},
{ {
"name": "linux-gnu-release", "name": "linux-gnu-release",
"configurePreset": "linux-gnu-release", "configurePreset": "linux-gnu-release",
@ -195,6 +251,15 @@
"configurePreset": "macos", "configurePreset": "macos",
"displayName": "[Debug] MacOS", "displayName": "[Debug] MacOS",
"description": "This preset is used to build in debug mode on MacOS", "description": "This preset is used to build in debug mode on MacOS",
"configuration": "Debug",
"jobs": 2
},
{
"name": "macos-relwithdebinfo",
"configurePreset": "macos",
"displayName": "[RelWithDebInfo] MacOS",
"description": "This preset is used to build in release mode with debug info on MacOS",
"configuration": "RelWithDebInfo",
"jobs": 2 "jobs": 2
}, },
{ {
@ -202,6 +267,7 @@
"configurePreset": "macos", "configurePreset": "macos",
"displayName": "[Release] MacOS", "displayName": "[Release] MacOS",
"description": "This preset is used to build in release mode on MacOS", "description": "This preset is used to build in release mode on MacOS",
"configuration": "Release",
"jobs": 2 "jobs": 2
} }
], ],
@ -235,6 +301,14 @@
"description": "Runs all tests on a Windows configuration", "description": "Runs all tests on a Windows configuration",
"configuration": "Debug" "configuration": "Debug"
}, },
{
"name": "windows-msvc-relwithdebinfo",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "RelWithDebInfo"
},
{ {
"name": "windows-msvc-release", "name": "windows-msvc-release",
"inherits": "windows-msvc-test", "inherits": "windows-msvc-test",
@ -251,6 +325,14 @@
"description": "Runs all tests on a Linux Clang configuration", "description": "Runs all tests on a Linux Clang configuration",
"configuration": "Release" "configuration": "Release"
}, },
{
"name": "linux-clang-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-clang-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "RelWithDebInfo"
},
{ {
"name": "linux-clang-release", "name": "linux-clang-release",
"inherits": "default", "inherits": "default",
@ -267,6 +349,14 @@
"description": "Runs all tests on a Linux GNU configuration", "description": "Runs all tests on a Linux GNU configuration",
"configuration": "Release" "configuration": "Release"
}, },
{
"name": "linux-gnu-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "RelWithDebInfo"
},
{ {
"name": "linux-gnu-release", "name": "linux-gnu-release",
"inherits": "default", "inherits": "default",
@ -283,6 +373,14 @@
"description": "Runs all tests on a MacOS configuration", "description": "Runs all tests on a MacOS configuration",
"configuration": "Debug" "configuration": "Debug"
}, },
{
"name": "macos-relwithdebinfo",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[RelWithDebInfo] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "RelWithDebInfo"
},
{ {
"name": "macos-release", "name": "macos-release",
"inherits": "default", "inherits": "default",
@ -329,6 +427,25 @@
} }
] ]
}, },
{
"name": "windows-msvc-relwithdebinfo",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "MSVC release with debug info workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-relwithdebinfo"
},
{
"type": "test",
"name": "windows-msvc-relwithdebinfo"
}
]
},
{ {
"name": "ci-windows-2022", "name": "ci-windows-2022",
"displayName": "[Release] Windows (MSVC)", "displayName": "[Release] Windows (MSVC)",
@ -367,6 +484,25 @@
} }
] ]
}, },
{
"name": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "GNU release with debug info workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-gnu-relwithdebinfo"
},
{
"type": "build",
"name": "linux-gnu-relwithdebinfo"
},
{
"type": "test",
"name": "linux-gnu-relwithdebinfo"
}
]
},
{ {
"name": "ci-ubuntu-22.04", "name": "ci-ubuntu-22.04",
"displayName": "[Release] Linux (GNU)", "displayName": "[Release] Linux (GNU)",
@ -405,6 +541,25 @@
} }
] ]
}, },
{
"name": "linux-clang-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (Clang)",
"description": "Clang release with debug info workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-relwithdebinfo"
},
{
"type": "build",
"name": "linux-clang-relwithdebinfo"
},
{
"type": "test",
"name": "linux-clang-relwithdebinfo"
}
]
},
{ {
"name": "linux-clang-release", "name": "linux-clang-release",
"displayName": "[Release] Linux (Clang)", "displayName": "[Release] Linux (Clang)",
@ -443,6 +598,25 @@
} }
] ]
}, },
{
"name": "macos-relwithdebinfo",
"displayName": "[RelWithDebInfo] MacOS",
"description": "Release with debug info workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-relwithdebinfo"
},
{
"type": "test",
"name": "macos-relwithdebinfo"
}
]
},
{ {
"name": "ci-macos-13", "name": "ci-macos-13",
"displayName": "[Release] MacOS", "displayName": "[Release] MacOS",

View File

@ -11,7 +11,7 @@ if(UNIX)
# -Wno-unused-result -Wno-unknown-pragmas -fpermissive # -Wno-unused-result -Wno-unknown-pragmas -fpermissive
target_compile_options(sqlite3 PRIVATE) target_compile_options(sqlite3 PRIVATE)
if(NOT APPLE) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(sqlite3 PRIVATE "-Wno-return-local-addr" "-Wno-maybe-uninitialized") target_compile_options(sqlite3 PRIVATE "-Wno-return-local-addr" "-Wno-maybe-uninitialized")
else() else()
target_compile_options(sqlite3 PRIVATE "-Wno-return-stack-address" "-Wno-uninitialized" "-Wno-deprecated-declarations") target_compile_options(sqlite3 PRIVATE "-Wno-return-stack-address" "-Wno-uninitialized" "-Wno-deprecated-declarations")