mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-04-11 19:28:30 +00:00
Add C++ modules support (#2291)
* Add C++ modules support * Add module examples * Missing semicolon * Update GitHub Actions script and create a modules updating script * Name the unused param * Use the guarded/direct export of header approach * Update CMakeLists.txt Co-authored-by: Andrea Pappacoda <andrea@pappacoda.it> * Update CMakeLists.txt Co-authored-by: Andrea Pappacoda <andrea@pappacoda.it> * Split scripts into split.py and generate_module.py --------- Co-authored-by: Andrea Pappacoda <andrea@pappacoda.it>
This commit is contained in:
16
cmake/modules.cmake
Normal file
16
cmake/modules.cmake
Normal file
@@ -0,0 +1,16 @@
|
||||
# This file contains C++20 module support requiring CMake 3.28+
|
||||
# Included conditionally to prevent parse errors on older CMake versions
|
||||
|
||||
if(HTTPLIB_BUILD_MODULES)
|
||||
if(POLICY CMP0155)
|
||||
cmake_policy(SET CMP0155 NEW)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
|
||||
|
||||
target_sources(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
FILE_SET CXX_MODULES FILES
|
||||
"${_httplib_build_includedir}/httplib.cppm"
|
||||
)
|
||||
endif()
|
||||
Reference in New Issue
Block a user