-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] prebuild set CMAKE_PREFIX_PATH properly #1154
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a59b766
try to fix prebuild
TingDaoK fc20894
print out the dir
TingDaoK 26986bc
add -B?
TingDaoK c4d2439
remove the debug message
TingDaoK d89397a
another way to fix it
TingDaoK 4765474
escape instead of setting the env var
TingDaoK 7310e92
Apply suggestions from code review
TingDaoK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,9 @@ function(aws_prebuild_dependency) | |
file(MAKE_DIRECTORY ${depBinaryDir}) | ||
|
||
# For execute_process to accept a dynamically constructed command, it should be passed in a list format. | ||
set(cmakeCommand "COMMAND" "${CMAKE_COMMAND}") | ||
set(cmakeCommand "${CMAKE_COMMAND}") | ||
list(APPEND cmakeCommand -S ${AWS_PREBUILD_SOURCE_DIR}) | ||
list(APPEND cmakeCommand -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) | ||
list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}) | ||
list(APPEND cmakeCommand -DCMAKE_INSTALL_PREFIX=${depInstallDir}) | ||
list(APPEND cmakeCommand -DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}) | ||
list(APPEND cmakeCommand -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}) | ||
|
@@ -39,11 +38,22 @@ function(aws_prebuild_dependency) | |
list(APPEND cmakeCommand ${AWS_PREBUILD_CMAKE_ARGUMENTS}) | ||
endif() | ||
|
||
list(APPEND cmakeCommand WORKING_DIRECTORY ${depBinaryDir}) | ||
list(APPEND cmakeCommand RESULT_VARIABLE result) | ||
# Set cmake prefix path via envrionment variable incase it's already a list. | ||
# Some version of cmake will treat the values in the list as separate args. | ||
if(WIN32) | ||
list(JOIN CMAKE_PREFIX_PATH ";" PREFIX_PATH_ENV_VAR) | ||
else() | ||
list(JOIN CMAKE_PREFIX_PATH ":" PREFIX_PATH_ENV_VAR) | ||
endif() | ||
set(ENV{CMAKE_PREFIX_PATH} ${PREFIX_PATH_ENV_VAR}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changing an environment variable seems like trouble |
||
|
||
# Configure dependency project. | ||
execute_process(${cmakeCommand}) | ||
execute_process( | ||
COMMAND ${cmakeCommand} | ||
WORKING_DIRECTORY ${depBinaryDir} | ||
RESULT_VARIABLE result | ||
) | ||
|
||
if (NOT ${result} EQUAL 0) | ||
message(FATAL_ERROR "Configuration failed for dependency project ${AWS_PREBUILD_DEPENDENCY_NAME}") | ||
endif() | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list(JOIN) is cmake 3.12+