From 808414c1645e361f829129c485cf302c99752acb Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Thu, 23 Jan 2025 11:01:57 +0100 Subject: [PATCH] build: Avoid using non-initialized variable Only shows up on MSVC --- build-support/custom-modules/ns3-module-macros.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-support/custom-modules/ns3-module-macros.cmake b/build-support/custom-modules/ns3-module-macros.cmake index 7dfbb73c60..c78ee953bd 100644 --- a/build-support/custom-modules/ns3-module-macros.cmake +++ b/build-support/custom-modules/ns3-module-macros.cmake @@ -443,7 +443,10 @@ endfunction() function(separate_ns3_from_non_ns3_libs libname libraries_to_link ns_libraries_to_link non_ns_libraries_to_link ) - set(non_ns_libs ${CMAKE_THREAD_LIBS_INIT}) + set(non_ns_libs) + if(DEFINED CMAKE_THREAD_LIBS_INIT) + list(APPEND non_ns_libs ${CMAKE_THREAD_LIBS_INIT}) + endif() set(ns_libs) foreach(library ${libraries_to_link}) remove_lib_prefix("${library}" module_name)