Add proper C++20 module support (#4799)

This commit is contained in:
Miko
2025-06-29 16:02:31 -04:00
committed by GitHub
parent d70e46bc65
commit b7f741165b
10 changed files with 123 additions and 24 deletions

View File

@@ -22,6 +22,18 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(ExternalProject)
# ---- C++ Modules Support (optional) ----
option(NLOHMANN_JSON_BUILD_MODULES "Build C++ modules support" OFF)
if(NLOHMANN_JSON_BUILD_MODULES)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
message(STATUS "Building nlohmann.json C++ module")
add_subdirectory(src/modules)
else()
message(WARNING "Skipping nlohmann.json C++ module (requires CMake 3.28+, found ${CMAKE_VERSION})")
endif()
endif()
##
## OPTIONS
##