build: Fix output paths for dlls and executables on MSVC

This commit is contained in:
Gabriel Ferreira
2025-01-24 12:57:59 +01:00
parent f779332992
commit d46b34e18a
2 changed files with 9 additions and 6 deletions

View File

@@ -17,9 +17,9 @@ function(set_runtime_outputdirectory target_name output_directory target_prefix)
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_directory}
RUNTIME_OUTPUT_NAME ${ns3-exec-outputname}
)
if(${XCODE})
# Is that so hard not to break people's CI, AAPL?? Why would you output the
# targets to a Debug/Release subfolder? Why?
if(${MSVC} OR ${XCODE})
# Prevent multi-config generators from placing output files into per
# configuration directory
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set_target_properties(

View File

@@ -208,9 +208,12 @@ function(build_lib)
PUBLIC_HEADER
"${BLIB_HEADER_FILES};${BLIB_DEPRECATED_HEADER_FILES};${CMAKE_HEADER_OUTPUT_DIRECTORY}/${BLIB_LIBNAME}-module.h"
PRIVATE_HEADER "${BLIB_PRIVATE_HEADER_FILES}"
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} # set output
# directory for
# DLLs
# set output directory for DLLs
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
)
if(${NS3_CLANG_TIMETRACE})