From 2daea2718ae413f6bf6c865969036276c974491a Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Mon, 25 Nov 2024 14:28:13 -0800 Subject: [PATCH] Add non-empty vars --- cmake/AwsPrebuildDependency.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/AwsPrebuildDependency.cmake b/cmake/AwsPrebuildDependency.cmake index 46d3dd5d9..2637f9594 100644 --- a/cmake/AwsPrebuildDependency.cmake +++ b/cmake/AwsPrebuildDependency.cmake @@ -117,10 +117,11 @@ function(aws_get_variables_for_prebuild_dependency AWS_CMAKE_PREBUILD_ARGS) OR var STREQUAL "CMAKE_SYSTEM_PROCESSOR" # Android-specific variables. OR var MATCHES "^(CMAKE_)?ANDROID_")) - set(escaped_var ${${var}}) # To store a list within another list, it needs to be escaped first. string(REPLACE ";" "\\\\;" escapedVar "${${var}}") - list(APPEND variables "-D${var}=${escapedVar}") + if (escapedVar) + list(APPEND variables "-D${var}=${escapedVar}") + endif() endif() # Other optional variables applicable both in cross-compiling and non-cross-compiling modes. @@ -138,10 +139,11 @@ function(aws_get_variables_for_prebuild_dependency AWS_CMAKE_PREBUILD_ARGS) OR var MATCHES "^CMAKE_RUNTIME_OUTPUT_DIRECTORY" OR var MATCHES "^CMAKE_ARCHIVE_OUTPUT_DIRECTORY" OR var MATCHES "^CMAKE_LIBRARY_OUTPUT_DIRECTORY") - set(escaped_var ${${var}}) # To store a list within another list, it needs to be escaped first. string(REPLACE ";" "\\\\;" escapedVar "${${var}}") - list(APPEND variables "-D${var}=${escapedVar}") + if (escapedVar) + list(APPEND variables "-D${var}=${escapedVar}") + endif() endif() endforeach()