diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000..601e4f8c --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,247 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "binaryDir": "${sourceDir}/build/${presetName}", + "installDir": "${sourceDir}/install/${presetName}", + "cacheVariables": { + "GAPP_USE_WERROR": "ON", + "GAPP_BUILD_TESTS": "ON", + "GAPP_BUILD_BENCHMARKS": "ON", + "GAPP_BUILD_EXAMPLES": "ON", + "GAPP_USE_LTO": "ON" + } + }, + { + "name": "windows-base", + "inherits": "base", + "hidden": true, + "generator": "Ninja", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "linux-base", + "inherits": "base", + "hidden": true, + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "msvc-debug", + "inherits": "windows-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_COMPILER": "cl" + } + }, + { + "name": "msvc-relwithdebinfo", + "inherits": "windows-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_CXX_COMPILER": "cl" + } + }, + { + "name": "msvc-release", + "inherits": "windows-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_COMPILER": "cl" + } + }, + { + "name": "msvc-dll", + "inherits": "msvc-release", + "cacheVariables": { + "BUILD_SHARED_LIBS": "ON" + } + }, + { + "name": "msvc-x86", + "inherits": "msvc-release", + "architecture": { + "value": "x86", + "strategy": "external" + } + }, + { + "name": "clang-cl-debug", + "inherits": "windows-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_COMPILER": "clang-cl" + } + }, + { + "name": "clang-cl-relwithdebinfo", + "inherits": "windows-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_CXX_COMPILER": "clang-cl" + } + }, + { + "name": "clang-cl-release", + "inherits": "windows-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_COMPILER": "clang-cl" + } + }, + { + "name": "clang-cl-dll", + "inherits": "clang-cl-release", + "cacheVariables": { + "BUILD_SHARED_LIBS": "ON" + } + }, + { + "name": "gcc-debug", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "gcc-relwithdebinfo", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "gcc-release", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "clang-debug", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_COMPILER": "clang++" + } + }, + { + "name": "clang-relwithdebinfo", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_CXX_COMPILER": "clang++" + } + }, + { + "name": "clang-release", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_COMPILER": "clang++" + } + }, + { + "name": "clang-tidy", + "inherits": "clang-release", + "cacheVariables": { + "CMAKE_CXX_CLANG_TIDY": "clang-tidy" + } + }, + { + "name": "asan", + "inherits": "clang-release", + "cacheVariables": { + "GAPP_CXX_FLAGS": "-fsanitize=address -g -fno-omit-frame-pointer" + } + }, + { + "name": "ubsan", + "inherits": "clang-release", + "cacheVariables": { + "GAPP_CXX_FLAGS": "-fsanitize=undefined -g -fno-omit-frame-pointer" + } + }, + { + "name": "tsan", + "inherits": "clang-release", + "cacheVariables": { + "GAPP_CXX_FLAGS": "-fsanitize=thread -g -fno-omit-frame-pointer" + } + }, + { + "name": "coverage", + "inherits": "gcc-debug", + "cacheVariables": { + "GAPP_CXX_FLAGS": "--coverage", + "CMAKE_EXE_LINKER_FLAGS": "--coverage", + "GAPP_BUILD_BENCHMARKS": "OFF", + "GAPP_BUILD_EXAMPLES": "OFF" + } + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "base", + "jobs": 0 + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "base", + "execution": { + "scheduleRandom": true + }, + "output": { + "outputOnFailure": true + } + }, + { + "name": "asan", + "inherits": "default", + "configurePreset": "asan", + "environment": { + "ASAN_OPTIONS": "check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:detect_leaks=1" + } + }, + { + "name": "ubsan", + "inherits": "default", + "configurePreset": "ubsan", + "environment": { + "UBSAN_OPTIONS": "print_stacktrace=1:print_summary=1" + } + }, + { + "name": "tsan", + "inherits": "default", + "configurePreset": "tsan", + "environment": { + "TSAN_OPTIONS": "verbosity=1:force_seq_cst_atomics=0" + } + } + ] +} diff --git a/CMakeSettings.json b/CMakeSettings.json deleted file mode 100644 index e58d6afd..00000000 --- a/CMakeSettings.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "configurations": [ - { - "name": "msvc-debug", - "generator": "Ninja", - "configurationType": "Debug", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_CXX_FLAGS=/analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset", - "enableMicrosoftCodeAnalysis": false, - "inheritEnvironments": [ "msvc_x64_x64" ] - }, - { - "name": "msvc-release", - "generator": "Ninja", - "configurationType": "Release", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset", - "enableMicrosoftCodeAnalysis": false, - "inheritEnvironments": [ "msvc_x64_x64" ] - }, - { - "name": "msvc-relWithDebInfo", - "generator": "Ninja", - "configurationType": "RelWithDebInfo", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset", - "enableMicrosoftCodeAnalysis": false, - "inheritEnvironments": [ "msvc_x64_x64" ] - }, - { - "name": "clang-debug", - "generator": "Ninja", - "configurationType": "Debug", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "enableClangTidyCodeAnalysis": false, - "inheritEnvironments": [ "clang_cl_x64_x64" ] - }, - { - "name": "clang-release", - "generator": "Ninja", - "configurationType": "Release", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "inheritEnvironments": [ "clang_cl_x64_x64" ] - }, - { - "name": "clang-relWithDebInfo", - "generator": "Ninja", - "configurationType": "RelWithDebInfo", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "inheritEnvironments": [ "clang_cl_x64_x64" ] - }, - { - "name": "msvc-dll", - "generator": "Ninja", - "configurationType": "Release", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_CXX_FLAGS=-analyze:WX- -DGAPP_USE_WERROR=ON -DBUILD_SHARED_LIBS=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset", - "enableMicrosoftCodeAnalysis": false, - "inheritEnvironments": [ "msvc_x64_x64" ] - }, - { - "name": "clang-dll", - "generator": "Ninja", - "configurationType": "Release", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DBUILD_SHARED_LIBS=ON -DGAPP_BUILD_TESTS=ON -DGAPP_BUILD_BENCHMARKS=ON -DGAPP_BUILD_EXAMPLES=ON -DGAPP_USE_LTO=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset", - "enableMicrosoftCodeAnalysis": false, - "inheritEnvironments": [ "clang_cl_x64_x64" ] - }, - { - "name": "clang-tidy", - "generator": "Ninja", - "configurationType": "Debug", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "inheritEnvironments": [ "clang_cl_x64_x64" ], - "variables": [ - { - "name": "CMAKE_CXX_CLANG_TIDY", - "value": "clang-tidy", - "type": "STRING" - } - ] - }, - { - "name": "core-guidelines-check", - "generator": "Ninja", - "configurationType": "Debug", - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "-DGAPP_CXX_FLAGS=/analyze:WX- -DGAPP_USE_WERROR=ON -DGAPP_BUILD_TESTS=ON", - "ctestCommandArgs": "--output-on-failure --schedule-random", - "codeAnalysisRuleset": "${projectDir}\\core-guidelines.ruleset", - "enableMicrosoftCodeAnalysis": true, - "disableExternalAnalysis": true, - "inheritEnvironments": [ "msvc_x64_x64" ], - "environments": [ { "CAExcludePath": "${projectDir}\\src\\algorithm\\reference_lines.cpp" } ] - } - ] -} \ No newline at end of file