Skip to content

Commit

Permalink
Rename generated files and add note
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1701c committed Jan 3, 2024
1 parent 6196f33 commit ec3255e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ file.hh.gch
compile_commands.json
.cache
Testing
.idea
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,6 @@ to_raw_string_literal(${SUPPORTED_CHECKS_JSON_STR} SUPPORTED_CHECKS_JSON_STR)
configure_file(checks.json.h.in checks.json.h)

enable_testing()
include(ClazyTests.cmake)
include(ClazyTests.generated.cmake)

install(FILES org.kde.clazy.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
2 changes: 2 additions & 0 deletions CheckSources.cmake → CheckSources.generated.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file was autogenerated by running: ./dev-scripts/generate.py --generate

set(CLAZY_CHECKS_SRCS ${CLAZY_CHECKS_SRCS}
${CMAKE_CURRENT_LIST_DIR}/src/checks/manuallevel/assert-with-side-effects.cpp
${CMAKE_CURRENT_LIST_DIR}/src/checks/manuallevel/container-inside-loop.cpp
Expand Down
2 changes: 1 addition & 1 deletion ClazySources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(CLAZY_CHECKS_SRCS
${CMAKE_CURRENT_LIST_DIR}/src/checks/detachingbase.cpp
${CMAKE_CURRENT_LIST_DIR}/src/checks/ruleofbase.cpp
)
include(CheckSources.cmake)
include(CheckSources.generated.cmake)

set(CLAZY_SHARED_SRCS # sources shared between clazy-standalone and clazy plugin
${CLAZY_CHECKS_SRCS}
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions dev-scripts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ def generate_register_checks(checks):
return False
#-------------------------------------------------------------------------------
def generate_cmake_file(checks):
text = "set(CLAZY_CHECKS_SRCS ${CLAZY_CHECKS_SRCS}\n"
text = "# This file was autogenerated by running: ./dev-scripts/generate.py --generate\n\nset(CLAZY_CHECKS_SRCS ${CLAZY_CHECKS_SRCS}\n"
for level in [-1, 0, 1, 2, 3]:
for check in checks:
if check.level == level:
text += " ${CMAKE_CURRENT_LIST_DIR}/src/" + check.qualified_cpp_filename() + "\n"
text += ")\n"

filename = clazy_source_path() + "CheckSources.cmake"
filename = clazy_source_path() + "CheckSources.generated.cmake"
old_text = read_file(filename)
if old_text != text:
write_file(filename, text)
Expand Down Expand Up @@ -472,7 +472,7 @@ def generate_readme(checks):
#-------------------------------------------------------------------------------
def generate_ctest(checks):
# Generates the ClazyTests.cmake file
filename = clazy_source_path() + 'ClazyTests.cmake'
filename = clazy_source_path() + 'ClazyTests.generated.cmake'

contents = """# This file was autogenerated by running: ./dev-scripts/generate.py --generate\n
macro(add_clazy_test name)
Expand Down

0 comments on commit ec3255e

Please sign in to comment.