build: disable precompiled headers when using GCC >=12.2
Prevents out-of-bounds error bug present in GCC >=12.2 that happens when precompiled headers are used with c++20 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
This commit is contained in:
@@ -28,6 +28,9 @@ Changes from ns-3.40 to ns-3-dev
|
||||
|
||||
### Changes to build system
|
||||
|
||||
* In preparation to enable C++20, the following actions have been taken due to compiler issues:
|
||||
* Precompiled headers have been disabled in GCC versions >= 12.2.
|
||||
|
||||
### Changed behavior
|
||||
|
||||
Changes from ns-3.39 to ns-3.40
|
||||
|
||||
@@ -244,6 +244,13 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||
# ns3-module-macros.cmake.
|
||||
set(GCC8 TRUE)
|
||||
endif()
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.2.0"))
|
||||
# PCH causes weird errors on certain versions of GCC when C++20 is enabled
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
|
||||
set(NS3_PRECOMPILE_HEADERS OFF
|
||||
CACHE BOOL "Precompile module headers to speed up compilation" FORCE
|
||||
)
|
||||
endif()
|
||||
set(GCC TRUE)
|
||||
add_definitions(-fno-semantic-interposition)
|
||||
if(${NS3_COLORED_OUTPUT} OR "$ENV{CLICOLOR}")
|
||||
|
||||
Reference in New Issue
Block a user