Skip to content

Commit 0836f9e

Browse files
committed
C++17 cmake flag
1 parent a1bbd3c commit 0836f9e

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ target_include_directories(vfspp
2121
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vendor/miniz-cpp>
2222
)
2323

24-
# Link the dependency
25-
# target_link_libraries(vfspp INTERFACE miniz-cpp)
24+
target_compile_features(vfspp INTERFACE cxx_std_17)

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,10 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/vendor/vfspp vfspp_build)
8484
```
8585
- For MSVC specify setting flag to use C++17
8686
```cmake
87-
if(MSVC)
88-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
89-
endif(MSVC)
90-
```
91-
- Add vfspp as dependency to your target
87+
- Add vfspp as dependency to your target and set C++17 standard
9288
```cmake
93-
target_link_libraries(vfsppexample PRIVATE vfspp)
89+
target_link_libraries(<your_project> PRIVATE vfspp)
90+
target_compile_features(<your_project> PRIVATE cxx_std_17)
9491
```
9592

9693
See examples/CMakeLists.txt for example of usage

examples/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,5 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. vfspp_build)
66

77
add_executable(vfsppexample example.cpp)
88

9-
if(MSVC)
10-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
11-
endif(MSVC)
12-
139
target_link_libraries(vfsppexample PRIVATE vfspp)
10+
target_compile_features(vfsppexample PRIVATE cxx_std_17)

0 commit comments

Comments
 (0)