Skip to content

Commit aad6dcd

Browse files
committed
fix: remove dependency on ${PROJECT_NAME}
1 parent 091e3d9 commit aad6dcd

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/Index.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ macro(ProjectOptions)
103103

104104
include("${ProjectOptions_SRC_DIR}/Tests.cmake")
105105
if(${ProjectOptions_ENABLE_COVERAGE})
106-
enable_coverage(${PROJECT_NAME})
106+
enable_coverage(project_options)
107107
endif()
108108

109109
# sanitizer options if supported by compiler
@@ -157,7 +157,7 @@ macro(ProjectOptions)
157157

158158
if(${ProjectOptions_ENABLE_UNITY})
159159
# Add for any project you want to apply unity builds for
160-
set_target_properties(${PROJECT_NAME} PROPERTIES UNITY_BUILD ON)
160+
set_target_properties(project_options PROPERTIES UNITY_BUILD ON)
161161
endif()
162162

163163
endmacro()

test/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ project(
1212
# include(${ProjectOptions_SOURCE_DIR}/Index.cmake)
1313
include(../src/Index.cmake)
1414

15-
add_library(escape INTERFACE)
16-
1715
# Initialize ProjectOptions
1816
# uncomment the options to enable them
1917
ProjectOptions(
@@ -29,7 +27,7 @@ ProjectOptions(
2927
# ENABLE_IPO
3028
# ENABLE_USER_LINKER
3129
ENABLE_BUILD_WITH_TIME_TRACE
32-
# ENABLE_UNITY
30+
ENABLE_UNITY
3331
# ENABLE_SANITIZER_ADDRESS
3432
# ENABLE_SANITIZER_LEAK
3533
# ENABLE_SANITIZER_UNDEFINED_BEHAVIOR
@@ -39,11 +37,10 @@ ProjectOptions(
3937

4038
# NOTE: project_options and project_warnings are defined inside ProjectOptions
4139
target_compile_features(project_options INTERFACE cxx_std_17)
42-
target_link_libraries(escape INTERFACE project_options project_warnings)
4340

4441
# add src, tests, etc here:
45-
add_executable(test_escape escape.cpp)
46-
target_link_libraries(test_escape PRIVATE escape)
42+
add_executable(escape escape.cpp)
43+
target_link_libraries(escape PRIVATE project_options project_warnings)
4744

4845
enable_testing()
49-
add_test(NAME test_escape COMMAND test_escape)
46+
add_test(NAME escape COMMAND escape)

0 commit comments

Comments
 (0)