@@ -96,13 +96,12 @@ endfunction()
96
96
function (aws_get_variables_for_prebuild_dependency AWS_CMAKE_PREBUILD_ARGS )
97
97
set (variables "" )
98
98
99
- # The CMake variables below were chosen for Linux, BSD, and Android platforms. If you want to use the prebuild logic
100
- # on other platforms, the chances are you have to handle additional variables (like CMAKE_OSX_SYSROOT). Refer to
101
- # https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html to update the list of handled variables, and
102
- # then you can enable a new platform here.
103
- if ((NOT UNIX ) OR APPLE )
104
- message (FATAL_ERROR "aws_get_variables_for_prebuild_dependency is called for unsupported platform" )
105
- endif ()
99
+
100
+ # The variables below were chosen based on reading docs and a lot of experimenting on different platforms.
101
+ # Is the list of variables below exhaustive and guaranteed to cover all cases? Probably not.
102
+ # So if you are here reading this, then its more than likely that some variable got missed and something
103
+ # is not building correctly. So don't be afraid to add more variables to the list.
104
+ # Refer to https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html as a decent starting point for which variables to handle.
106
105
107
106
get_cmake_property (vars CACHE_VARIABLES )
108
107
foreach (var ${vars} )
@@ -137,7 +136,12 @@ function(aws_get_variables_for_prebuild_dependency AWS_CMAKE_PREBUILD_ARGS)
137
136
OR var STREQUAL "CMAKE_MAKE_PROGRAM"
138
137
OR var MATCHES "^CMAKE_RUNTIME_OUTPUT_DIRECTORY"
139
138
OR var MATCHES "^CMAKE_ARCHIVE_OUTPUT_DIRECTORY"
140
- OR var MATCHES "^CMAKE_LIBRARY_OUTPUT_DIRECTORY" )
139
+ OR var MATCHES "^CMAKE_LIBRARY_OUTPUT_DIRECTORY"
140
+ OR var STREQUAL "CMAKE_OSX_ARCHITECTURES"
141
+ OR var STREQUAL "CMAKE_OSX_DEPLOYMENT_TARGET"
142
+ OR var STREQUAL "CMAKE_OSX_SYSROOT"
143
+ OR var MATCHES "^CMAKE_GENERATOR"
144
+ )
141
145
# To store a list within another list, it needs to be escaped first.
142
146
string (REPLACE ";" "\\\\ ;" escapedVar "${${var} }" )
143
147
if (escapedVar )
0 commit comments