From d8ec5caa601386ea7c31f09c19fa1d1753a533e4 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Tue, 20 May 2025 22:39:10 +0200 Subject: [PATCH] build: Disable inlining and increase stack size on ClangCL/MSVC --- .../custom-modules/ns3-platform-support.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build-support/custom-modules/ns3-platform-support.cmake b/build-support/custom-modules/ns3-platform-support.cmake index 16a4a8453..27f9a5cd4 100644 --- a/build-support/custom-modules/ns3-platform-support.cmake +++ b/build-support/custom-modules/ns3-platform-support.cmake @@ -111,7 +111,11 @@ if(${MSVC}) _CRT_SECURE_NO_WARNINGS NS_MSVC NOMINMAX ) - # Allow unresolved symbols as in most cases they are simply in other ns-3 - # libraries - add_link_options("/FORCE:UNRESOLVED") + # Disable inlining (trust me, it is either that or moving every single inlined + # code to .cc) + add_compile_options(/Ob0) + + # Prevent linker from eliminating unused functions and increase stack size to + # 8MB to match Linux + add_link_options(/OPT:NOREF /STACK:8388608) endif()