From b857ca373297c553fc9cba1e5df16eb5c11d15f0 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Mon, 31 Oct 2022 10:24:12 -0300 Subject: [PATCH] build: (fixes #798) ignore the version.cache build profile --- build-support/custom-modules/ns3-versioning.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-support/custom-modules/ns3-versioning.cmake b/build-support/custom-modules/ns3-versioning.cmake index 02a9f71f8..a12c66301 100644 --- a/build-support/custom-modules/ns3-versioning.cmake +++ b/build-support/custom-modules/ns3-versioning.cmake @@ -196,6 +196,16 @@ function(configure_embedded_version) set(NS3_${varname} ${varvalue}) endforeach() set(NS3_VERSION_CLOSEST_TAG ${NS3_CLOSEST_TAG}) + + # We overwrite the build profile from version.cache with the current build + # profile + if(${cmakeBuildType} STREQUAL relwithdebinfo) + set(NS3_VERSION_BUILD_PROFILE default) + elseif((${cmakeBuildType} STREQUAL release) AND ${NS3_NATIVE_OPTIMIZATIONS}) + set(NS3_VERSION_BUILD_PROFILE optimized) + else() + set(NS3_VERSION_BUILD_PROFILE ${cmakeBuildType}) + endif() endif() set(DIRTY)