Skip to content

Commit

Permalink
Fix user needs to set C++17 on their target to link to Adiar
Browse files Browse the repository at this point in the history
  • Loading branch information
SSoelvsten committed Jun 21, 2021
1 parent 2e4eb05 commit 8fcc04e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ _CMakeLists.txt_ file with the following lines.
```cmake
add_executable(<target> <source>)
target_link_libraries(<target> adiar)
set_target_properties(<target> PROPERTIES CXX_STANDARD 17)
```

You only need to include the third line if the `CXX_STANDARD` has not been set
project-wide to 17 or higher.

## Usage
After having linked the C++ source file with _Adiar_ as described above, then
one needs to include the `<adiar/adiar.h>` header, initialise the library before
Expand Down
2 changes: 2 additions & 0 deletions src/adiar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ set_target_properties(adiar PROPERTIES
POSITION_INDEPENDENT_CODE ON
)

target_compile_features(adiar PUBLIC cxx_std_17)

install(TARGETS adiar
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down

0 comments on commit 8fcc04e

Please sign in to comment.