From a733f365766b7478711172774f81b3a9f946a702 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 17 Jun 2025 14:38:15 +0500 Subject: [PATCH] CMake - set C++17 as the minimum required version (34676a567) Currently IfcOpenShell doesn't compile for C++14 (it stumbles upon `invoke_result_t` in XmlSerializer.cpp) and I'm not sure if it's needed. --- cmake/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 65e166aad2..1fdc77a362 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -18,6 +18,12 @@ ################################################################################ cmake_minimum_required(VERSION 3.21) +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() +if (CMAKE_CXX_STANDARD LESS 17) + message(FATAL_ERROR "C++17 or newer is required.") +endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged set(CMAKE_EXPORT_COMPILE_COMMANDS ON)