Skip to content

Commit eb3e6ae

Browse files
committed
fix CMakeLists again...
1 parent 776108e commit eb3e6ae

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,11 @@ try_compile(HAVE_STRING_VIEW
3939
"${CMAKE_CURRENT_BINARY_DIR}/try_compile"
4040
"${CMAKE_CURRENT_SOURCE_DIR}/try_compile/try_string_view.cpp")
4141

42-
if (HAVE_STRING_VIEW)
43-
add_definitions(-DHAVE_STRING_VIEW)
44-
endif()
45-
4642
try_compile(HAVE_OPTIONAL
4743
"${CMAKE_CURRENT_BINARY_DIR}/try_compile"
4844
"${CMAKE_CURRENT_SOURCE_DIR}/try_compile/try_optional.cpp")
4945

50-
if (HAVE_OPTIONAL)
51-
add_definitions(-DHAVE_OPTIONAL)
52-
endif()
46+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${PROJECT_SOURCE_DIR}/config.h)
5347

5448
add_subdirectory(test)
5549

config.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#cmakedefine HAVE_STRING_VIEW
2+
#cmakedefine HAVE_OPTIONAL

0 commit comments

Comments
 (0)