Skip to content

Commit

Permalink
Remove prefix for warning guard
Browse files Browse the repository at this point in the history
There was never really a need to prefix this normal variable and the
prefix just made the identifier unnecessarily long.
  • Loading branch information
friendlyanon committed Nov 6, 2021
1 parent 7772132 commit bd82f35
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmake-init/templates/c/executable/CMakeLists.txt
Expand Up @@ -23,7 +23,7 @@ add_library(
)

target_include_directories(
%(name)s_lib ${%(name)s_warning_guard}
%(name)s_lib ${warning_guard}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>"
)
Expand Down
2 changes: 1 addition & 1 deletion cmake-init/templates/c/header/CMakeLists.txt
Expand Up @@ -26,7 +26,7 @@ set_property(
)

target_include_directories(
%(name)s_%(name)s ${%(name)s_warning_guard}
%(name)s_%(name)s ${warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
Expand Down
2 changes: 1 addition & 1 deletion cmake-init/templates/c/shared/CMakeLists.txt
Expand Up @@ -44,7 +44,7 @@ set_target_properties(
)

target_include_directories(
%(name)s_%(name)s ${%(name)s_warning_guard}
%(name)s_%(name)s ${warning_guard}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
Expand Down
4 changes: 2 additions & 2 deletions cmake-init/templates/common/cmake/variables.cmake
Expand Up @@ -23,7 +23,7 @@ endif()
# to omit warnings from the provided paths, if the compiler supports that
# This is to provide a user experience similar to find_package when
# add_subdirectory or FetchContent is used to consume this project
set(%(name)s_warning_guard "")
set(warning_guard "")
if(NOT PROJECT_IS_TOP_LEVEL)
option(
%(name)s_INCLUDES_WITH_SYSTEM
Expand All @@ -32,6 +32,6 @@ if(NOT PROJECT_IS_TOP_LEVEL)
)
mark_as_advanced(%(name)s_INCLUDES_WITH_SYSTEM)
if(%(name)s_INCLUDES_WITH_SYSTEM)
set(%(name)s_warning_guard SYSTEM)
set(warning_guard SYSTEM)
endif()
endif()
2 changes: 1 addition & 1 deletion cmake-init/templates/executable/CMakeLists.txt
Expand Up @@ -23,7 +23,7 @@ add_library(
)

target_include_directories(
%(name)s_lib ${%(name)s_warning_guard}
%(name)s_lib ${warning_guard}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>"
)
Expand Down
2 changes: 1 addition & 1 deletion cmake-init/templates/header/CMakeLists.txt
Expand Up @@ -26,7 +26,7 @@ set_property(
)

target_include_directories(
%(name)s_%(name)s ${%(name)s_warning_guard}
%(name)s_%(name)s ${warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
Expand Down
2 changes: 1 addition & 1 deletion cmake-init/templates/shared/CMakeLists.txt
Expand Up @@ -46,7 +46,7 @@ set_target_properties(
)

target_include_directories(
%(name)s_%(name)s ${%(name)s_warning_guard}
%(name)s_%(name)s ${warning_guard}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
Expand Down

0 comments on commit bd82f35

Please sign in to comment.