Skip to content

Commit 8e2d142

Browse files
authored
Disable C++20 module scanning in CMake
Disable C++20 module scanning for compatibility with GCC/Clang.
1 parent 0c150c1 commit 8e2d142

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
cmake_minimum_required(VERSION 3.28)
22

3+
# Disable C++20 module scanning for compatibility with GCC/Clang (CMake 3.31+)
4+
# CMP0155: C++ module dependencies are supported by Ninja Generators
5+
if (POLICY CMP0155)
6+
cmake_policy(SET CMP0155 OLD)
7+
endif ()
8+
set(CMAKE_CXX_SCAN_FOR_MODULES OFF CACHE BOOL "Disable C++20 module scanning" FORCE)
9+
310
project(towerforge VERSION 0.1.0 LANGUAGES CXX)
411

512
# Enable testing at the root level for CTest to work with presets
613
enable_testing()
714

8-
915
# Include directories
1016
include_directories(${CMAKE_SOURCE_DIR}/include)
1117

12-
1318
# Subdirectories for modules
1419
add_subdirectory(src/core)
1520

0 commit comments

Comments
 (0)