Skip to content

Commit b2da041

Browse files
committed
Fix Windows CI build errors and add System Design section to README
CMakeLists.txt: - Add CMAKE_CXX_SCAN_FOR_MODULES=OFF to fix yaml-cpp modmap errors with CMake 3.28+ and MinGW on Windows - Add SPDLOG_USE_STD_FORMAT=ON to fix spdlog consteval errors with Clang and C++20 on Windows README.md: - Add C++ System Design section covering memory management, concurrency patterns, design patterns, and system architecture
1 parent 834a072 commit b2da041

2 files changed

Lines changed: 31 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ set(CMAKE_CXX_STANDARD 20) # Replace 20 with the version number of the latest C+
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212
set(CMAKE_CXX_EXTENSIONS OFF)
1313

14+
# Disable C++20 module scanning (CMake 3.28+)
15+
# Dependencies like yaml-cpp, spdlog don't support C++20 modules yet
16+
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
17+
1418
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
1519
message("using Visual Studio C++")
1620

@@ -553,8 +557,12 @@ endif()
553557

554558
if(ENABLE_SPDLOG)
555559
message("\n########################################## spdlog ##########################################\n")
556-
# Fetch spdlog
557-
FetchContent_Declare(
560+
561+
# Use std::format (C++20) instead of bundled fmt to avoid Clang/Windows consteval bug
562+
set(SPDLOG_USE_STD_FORMAT ON CACHE BOOL "Use std::format instead of bundled fmt")
563+
564+
# Fetch spdlog
565+
FetchContent_Declare(
558566
spdlog
559567
GIT_REPOSITORY https://github.com/gabime/spdlog.git
560568
GIT_TAG v1.14.1 # Use a specific tag, branch, or commit
@@ -567,9 +575,6 @@ FetchContent_Declare(
567575

568576
# Link spdlog to your target
569577
target_link_libraries(spdlog_example PRIVATE spdlog::spdlog)
570-
571-
# Optionally, if you want to disable spdlog's automatic formatting, add the following:
572-
# target_compile_definitions(MyExecutable PRIVATE SPDLOG_FMT_EXTERNAL)
573578

574579
else()
575580
message("spdlog is not enabled")
@@ -625,6 +630,6 @@ endif()
625630

626631

627632

628-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
629-
add_executable(main src/main.cpp)
630-
endif()
633+
# if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
634+
# add_executable(main src/main.cpp)
635+
# endif()

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,24 @@ This change ensures that VSCode uses the "Ninja Multi-Config" generator by defau
382382
- [isocpp](https://isocpp.org/wiki/faq/coding-standards)
383383
- [Bjarne Stroustrup's C++ Style](https://www.stroustrup.com/bs_faq2.html)
384384

385+
## [C++ System Design](#)
386+
387+
- [Memory Management Strategies (Pool, Arena, Slab Allocators)](docs/system_design/memory_management.md)
388+
- [Object-Oriented Design Patterns (Factory, Singleton, Observer, Strategy)](docs/system_design/design_patterns.md)
389+
- [Concurrency Patterns (Thread Pool, Producer-Consumer, Active Object)](docs/system_design/concurrency_patterns.md)
390+
- [Lock-Free and Wait-Free Data Structures](docs/system_design/lock_free_structures.md)
391+
- [Cache-Friendly Data Structures and Data-Oriented Design](docs/system_design/cache_friendly_design.md)
392+
- [Plugin Architecture and Dynamic Loading](docs/system_design/plugin_architecture.md)
393+
- [Event-Driven Architecture and State Machines](docs/system_design/event_driven_state_machines.md)
394+
- [API and ABI Design for C++ Libraries](docs/system_design/api_abi_design.md)
395+
- [SOLID Principles in C++](docs/system_design/solid_principles.md)
396+
- [Real-Time Systems Design](docs/system_design/realtime_systems.md)
397+
- [Embedded Systems Design](docs/system_design/embedded_systems.md)
398+
- [Game Engine Architecture](docs/system_design/game_engine_architecture.md)
399+
- [High-Performance Computing (HPC) Patterns](docs/system_design/hpc_patterns.md)
400+
- [Serialization and Deserialization (Protobuf, FlatBuffers)](docs/system_design/serialization.md)
401+
- [Error Handling Strategies and Fault Tolerance](docs/system_design/error_handling_strategies.md)
402+
385403
## [VSCode](#)
386404

387405
- [`tasks.json`, `settings.json`, `launch.json`](docs/vscode.md)

0 commit comments

Comments
 (0)