0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00

CMake: Refine CXX_STANDARD setting

- Set CXX_STANDARD_REQUIRED ON so that we error out early
  if CMake thinks that the compiler does not support the
  used standard.
- Set CXX_EXTENSIONS OFF so that we get less compiler
  specific behavior.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2023-10-13 15:20:47 +02:00 committed by David Sommerseth
parent 268bf42b9e
commit 9b8797fe5e
No known key found for this signature in database
GPG Key ID: 86CF944C9671FDF2
2 changed files with 4 additions and 3 deletions

View File

@ -21,6 +21,8 @@ set(CMAKE_LINKER_FLAGS_ASAN
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 99)
include(CTest)

View File

@ -1,12 +1,11 @@
cmake_minimum_required(VERSION 3.13...3.28)
set(CMAKE_CXX_STANDARD 17)
#cmake_policy(SET CMP0079 NEW)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CORE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
set(DEP_DIR ${CORE_DIR}/../deps CACHE PATH "Dependencies")
option(USE_MBEDTLS "Use mbed TLS instead of OpenSSL")