mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-11-30 07:55:31 +08:00
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:
2
scripts/file_linter.py
Normal file → Executable file
2
scripts/file_linter.py
Normal file → Executable 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,
|
||||
"--",
|
||||
],
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user