cmake: Allow C++17 mode on all platforms, all modules.

Remove per-module C++17 settings.
This commit is contained in:
Ryan Pavlik 2021-04-30 15:27:49 -05:00
parent daccde940e
commit e82fafb186
7 changed files with 6 additions and 19 deletions

View file

@ -1,4 +1,4 @@
# Copyright 2018-2020, Collabora, Ltd. # Copyright 2018-2021, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0 # SPDX-License-Identifier: BSL-1.0
cmake_minimum_required(VERSION 3.10.2) cmake_minimum_required(VERSION 3.10.2)
@ -12,6 +12,10 @@ endif()
option(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." ON) option(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." ON)
option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON) option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON)
# We use C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
### ###
# Dependencies # Dependencies
### ###

View file

@ -0,0 +1 @@
For code that is implemented in C++, note that the default standard mode is now C++17 across all platforms and modules, instead of a mix of 14 and 17 like before. The CI remains the decider of what functionality is available, as it contains the oldest distribution we support (Debian Buster).

View file

@ -40,10 +40,6 @@ if(ANDROID)
${WRAP_SOURCES}) ${WRAP_SOURCES})
target_include_directories(xrt-external-jni-wrap PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android-jni-wrap) target_include_directories(xrt-external-jni-wrap PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android-jni-wrap)
target_link_libraries(xrt-external-jni-wrap PUBLIC xrt-external-jnipp) target_link_libraries(xrt-external-jni-wrap PUBLIC xrt-external-jnipp)
set_target_properties(xrt-external-jni-wrap
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
endif() endif()
# OpenXR # OpenXR

View file

@ -304,10 +304,6 @@ if(ANDROID)
PUBLIC aux_util PUBLIC aux_util
PRIVATE ${ANDROID_LIBRARY} ${ANDROID_LOG_LIBRARY} xrt-external-jni-wrap xrt-external-jnipp PRIVATE ${ANDROID_LIBRARY} ${ANDROID_LOG_LIBRARY} xrt-external-jni-wrap xrt-external-jnipp
) )
set_target_properties(aux_android
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
target_link_libraries(aux_vk PUBLIC aux_android) target_link_libraries(aux_vk PUBLIC aux_android)
endif() endif()

View file

@ -276,7 +276,6 @@ if (XRT_BUILD_DRIVER_ILLIXR)
add_library(drv_illixr STATIC ${ILLIXR_SOURCE_FILES}) add_library(drv_illixr STATIC ${ILLIXR_SOURCE_FILES})
target_link_libraries(drv_illixr PUBLIC ${CMAKE_DL_LIBS} xrt-interfaces aux_util aux_os) target_link_libraries(drv_illixr PUBLIC ${CMAKE_DL_LIBS} xrt-interfaces aux_util aux_os)
target_include_directories(drv_illixr PUBLIC ${ILLIXR_PATH}) target_include_directories(drv_illixr PUBLIC ${ILLIXR_PATH})
target_compile_options(drv_illixr PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
list(APPEND ENABLED_HEADSET_DRIVERS illixr) list(APPEND ENABLED_HEADSET_DRIVERS illixr)
endif() endif()

View file

@ -110,10 +110,6 @@ if(ANDROID)
xrt-external-jnipp xrt-external-jnipp
aux_android aux_android
) )
set_target_properties(ipc_android
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
target_sources(ipc_server PRIVATE target_sources(ipc_server PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_android.c ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_android.c
) )

View file

@ -15,8 +15,3 @@ target_link_libraries(monado-service PRIVATE
target_instance target_instance
xrt-external-jni-wrap xrt-external-jni-wrap
) )
set_target_properties(monado-service
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)