mirror of
https://github.com/nlohmann/json.git
synced 2025-11-23 19:34:10 +08:00
Add proper C++20 module support (#4799)
This commit is contained in:
@@ -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
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user