Skip to content

Commit 7226baf

Browse files
committed
Fix clang-tidy configuration and enforce standard C++17
CLANG-TIDY FIXES: - Remove problematic semicolon from clang-tidy command - Changed 'clang-tidy;' to 'clang-tidy' (empty argument was causing errors) - Fixed 'unable to handle compilation' error C++17 STANDARD ENFORCEMENT: - Added CMAKE_CXX_EXTENSIONS=OFF to all presets - Forces standard C++17 instead of GNU++17 - Ensures consistent compilation across all build types TESTING: - Verified clang-tidy preset now builds successfully - Confirmed standard C++17 usage
1 parent 2bd17ec commit 7226baf

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cmake/cpp-library-setup.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function(_cpp_library_setup_core)
3131
$<INSTALL_INTERFACE:include>
3232
)
3333

34-
# Set C++ standard requirement
34+
# Set C++ standard requirement
3535
target_compile_features(${ARG_NAME} INTERFACE cxx_std_${ARG_REQUIRES_CPP_VERSION})
3636

3737
# Set up installation if headers are specified

templates/CMakePresets.json.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"generator": "Ninja",
1010
"cacheVariables": {
1111
"CMAKE_BUILD_TYPE": "Release",
12-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
12+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
13+
"CMAKE_CXX_EXTENSIONS": "OFF"
1314
}
1415
},
1516
{
@@ -21,7 +22,8 @@
2122
"cacheVariables": {
2223
"CMAKE_BUILD_TYPE": "Debug",
2324
"BUILD_TESTING": "ON",
24-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
25+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
26+
"CMAKE_CXX_EXTENSIONS": "OFF"
2527
}
2628
},
2729
{
@@ -41,7 +43,8 @@
4143
"binaryDir": "${sourceDir}/build/clang-tidy",
4244
"inherits": "test",
4345
"cacheVariables": {
44-
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;"
46+
"CMAKE_CXX_CLANG_TIDY": "clang-tidy",
47+
"CMAKE_CXX_EXTENSIONS": "OFF"
4548
}
4649
},
4750
{

0 commit comments

Comments
 (0)