Skip to content

Commit

Permalink
Add include guard for kassert target.
Browse files Browse the repository at this point in the history
This prevents duplicate targets when kassert is included by multiple
dependencies of another project.
  • Loading branch information
niklas-uhl committed Nov 30, 2023
1 parent e683aef commit a5ed13a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ project(
LANGUAGES CXX
)

# include guard to prevent duplicate targets when including this project as a subdirectory
if (TARGET kassert)
return()
endif ()

if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# folder support for IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down

0 comments on commit a5ed13a

Please sign in to comment.