From e7974ff08b574d7daf40f3e40279671e7780ead7 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 11 Jul 2022 12:10:06 -0700 Subject: [PATCH] Change option logic Signed-off-by: methylDragon --- cmake/GzSetCompilerFlags.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/GzSetCompilerFlags.cmake b/cmake/GzSetCompilerFlags.cmake index f5f06227..7848f544 100644 --- a/cmake/GzSetCompilerFlags.cmake +++ b/cmake/GzSetCompilerFlags.cmake @@ -350,10 +350,15 @@ macro(_gz_setup_msvc) # In some cases, a user might want to compile with the static runtime. This # should ONLY be done if they do not intend to use the Gazebo library as # part of a plugin-based framework. - option(GZ_USE_STATIC_RUNTIME "Use the static runtime (strongly discouraged)" OFF) - option(IGN_USE_STATIC_RUNTIME # TODO(CH3): Deprecated. Remove on tock. - "Deprecated. Use [GZ_USE_STATIC_RUNTIME] instead! Use the static runtime (strongly discouraged)" - ${GZ_USE_STATIC_RUNTIME}) + + if(IGN_USE_STATIC_RUNTIME) # TODO(CH3): Deprecated. Remove on tock. + message(WARNING "Deprecated. Use [GZ_USE_STATIC_RUNTIME] instead! Use the static runtime (strongly discouraged)") + set(GZ_USE_STATIC_RUNTIME ${IGN_USE_STATIC_RUNTIME}) + else() + option(GZ_USE_STATIC_RUNTIME "Use the static runtime (strongly discouraged)" OFF) + set(IGN_USE_STATIC_RUNTIME ${GZ_USE_STATIC_RUNTIME}) + endif() + if(BUILD_SHARED_LIBS) # Users should not choose the static runtime unless they are compiling a # static library, so we completely disable this option if BUILD_SHARED_LIBS