Skip to content

Commit 409fe97

Browse files
committed
Explicitly request C++14 compiler
Try to avoid errors on mac os which seems to use an older compiler by default #5
1 parent 45785e7 commit 409fe97

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@ target_include_directories(multiprocess PUBLIC
3131
$<INSTALL_INTERFACE:include>
3232
${CAPNP_INCLUDE_DIRECTORY}
3333
${Boost_INCLUDE_DIR})
34-
set_target_properties(multiprocess PROPERTIES PUBLIC_HEADER "${MP_PUBLIC_HEADERS}")
34+
set_target_properties(multiprocess PROPERTIES
35+
PUBLIC_HEADER "${MP_PUBLIC_HEADERS}"
36+
CXX_STANDARD 14
37+
CXX_STANDARD_REQUIRED YES)
3538
install(TARGETS multiprocess EXPORT Multiprocess ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/mp)
3639

3740
add_executable(mpgen src/mp/gen.cpp)
3841
target_include_directories(mpgen PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
3942
target_include_directories(mpgen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
4043
target_link_libraries(mpgen PRIVATE CapnProto::capnp-rpc)
4144
target_link_libraries(mpgen PRIVATE -L${capnp_LIBRARY_DIRS} capnpc)
42-
set_target_properties(mpgen PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
45+
set_target_properties(mpgen PROPERTIES
46+
INSTALL_RPATH_USE_LINK_PATH TRUE
47+
CXX_STANDARD 14
48+
CXX_STANDARD_REQUIRED YES)
4349
install(TARGETS mpgen EXPORT Multiprocess RUNTIME DESTINATION bin)
4450

4551
configure_file(pkgconfig/libmultiprocess.pc.in "${CMAKE_CURRENT_BINARY_DIR}/libmultiprocess.pc" @ONLY)
@@ -86,5 +92,8 @@ if(BUILD_TESTING)
8692
target_link_libraries(mptest PRIVATE CapnProto::capnp-rpc)
8793
target_link_libraries(mptest PRIVATE CapnProto::kj-test)
8894
target_link_libraries(mptest PRIVATE multiprocess)
95+
set_target_properties(mptest PROPERTIES
96+
CXX_STANDARD 14
97+
CXX_STANDARD_REQUIRED YES)
8998
add_test(NAME mptest COMMAND mptest)
9099
endif()

0 commit comments

Comments
 (0)