chore: make clang-tidy use cxx17 for linting (#3295)

* chore: make sorting directory use c++17

* chore: make clang-tidy use standard present in compile commands
This commit is contained in:
realstealthninja
2026-11-29 23:32:46 +00:00
committed by GitHub
parent b924df9dd4
commit 687d879c7a
2 changed files with 11 additions and 14 deletions

2
scripts/file_linter.py Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
@@ -31,7 +32,6 @@ with open("git_diff.txt") as in_file:
"clang-tidy",
"--fix",
"-p=build",
"--extra-arg=-std=c++11",
*cpp_files,
"--",
],

View File

@@ -1,20 +1,17 @@
# If necessary, use the RELATIVE flag, otherwise each source file may be listed
# with full pathname. RELATIVE may makes it easier to extract an executable name
# automatically.
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp )
file(GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
# file( GLOB APP_SOURCES ${CMAKE_SOURCE_DIR}/*.c )
# AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} APP_SOURCES)
foreach( testsourcefile ${APP_SOURCES} )
# I used a simple string replace, to cut off .cpp.
string( REPLACE ".cpp" "" testname ${testsourcefile} )
add_executable( ${testname} ${testsourcefile} )
foreach(testsourcefile ${APP_SOURCES})
# I used a simple string replace, to cut off .cpp.
string(REPLACE ".cpp" "" testname ${testsourcefile})
add_executable(${testname} ${testsourcefile})
set_target_properties(${testname} PROPERTIES
LINKER_LANGUAGE CXX
CXX_STANDARD 14)
if(OpenMP_CXX_FOUND)
target_link_libraries(${testname} OpenMP::OpenMP_CXX)
endif()
install(TARGETS ${testname} DESTINATION "bin/sorting")
if(OpenMP_CXX_FOUND)
target_link_libraries(${testname} OpenMP::OpenMP_CXX)
endif()
install(TARGETS ${testname} DESTINATION "bin/sorting")
endforeach( testsourcefile ${APP_SOURCES} )
endforeach()