Skip to content

Commit

Permalink
Add non-empty vars
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Nov 25, 2024
1 parent 23bae32 commit 2daea27
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmake/AwsPrebuildDependency.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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()

Expand Down

0 comments on commit 2daea27

Please sign in to comment.