From 68fe4256c67c955374404bbe4b20e5437dfec6cd Mon Sep 17 00:00:00 2001 From: jolavillette Date: Mon, 1 Jun 2026 09:55:58 +0200 Subject: [PATCH] fix(build): enforce global C++17 and enable macOS dynamic lookup for plugins --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fd5a3588..6d48599a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,17 @@ cmake_minimum_required(VERSION 3.5.0) set(CMAKE_POLICY_VERSION_MINIMUM 3.5) project(retroshare-monorepo) +# Force C++17 globally for all targets (including plugins) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if(APPLE) + # On macOS, allow undefined symbols in shared modules/libraries at link time + # because they will be resolved at runtime by the host executable (retroshare-gui) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -undefined dynamic_lookup") +endif() + # Global setting to allow executables to export symbols for plugin/module linking set(CMAKE_ENABLE_EXPORTS ON)