Skip to content

Commit

Permalink
CMake config: Set minimum C++ version needed in a different way
Browse files Browse the repository at this point in the history
This setting should be overwritten if CMake find that some library needs
an even more modern version.
  • Loading branch information
joto committed Jan 6, 2024
1 parent 374895c commit aa24121
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
env:
CC: clang
CXX: clang++
CXXFLAGS: -Werror -Wall -pedantic -std=c++17
CXXFLAGS: -Werror -Wall -pedantic
BUILD_TYPE: Debug
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 4 additions & 2 deletions osmpbf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
protobuf_generate_cpp(CPPS HS fileformat.proto osmformat.proto)

add_library(osmpbf STATIC ${CPPS})
target_compile_features(osmpbf PUBLIC cxx_std_11)
target_include_directories(osmpbf SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS})
set_property(TARGET osmpbf PROPERTY CXX_STANDARD 11)
#set_property(TARGET osmpbf PROPERTY CXX_STANDARD 11)
install(TARGETS osmpbf ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

add_library(osmpbf_shared SHARED ${CPPS})
set_property(TARGET osmpbf_shared PROPERTY CXX_STANDARD 11)
#set_property(TARGET osmpbf_shared PROPERTY CXX_STANDARD 11)
target_compile_features(osmpbf_shared PUBLIC cxx_std_11)
target_link_libraries(osmpbf_shared PRIVATE protobuf::libprotobuf)
target_include_directories(osmpbf_shared SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS})
set_target_properties(osmpbf_shared PROPERTIES OUTPUT_NAME osmpbf
Expand Down

0 comments on commit aa24121

Please sign in to comment.