Skip to content

Pass CMAKE_GENERATOR_PLATFORM to third-party build if set #1187

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

Closed
wants to merge 1 commit into from

Conversation

ihnorton
Copy link

@ihnorton ihnorton commented Jul 6, 2019

Issue #, if available:

Specifically resolves an issue I encountered while building the SDK within a larger project.

May also help with #1087 (in combination with adding -A x64 to the CMake call creating the AWSSDK project in conan).

Description of changes:

Pass the CMAKE_GENERATOR_PLATFORM to the execute_process calls used to create cmake projects for the third-party builds, if that parameter has been set. This fixes an issue I observed when setting the top-level generator to Visual Studio 15 2017 (rather than Visual Studio 15 2017 Win64), where the third-party modules were all built as 32-bit x86 objects, causing LNK2019 errors.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ihnorton
Copy link
Author

ihnorton commented Jul 9, 2019

Note that the underlying issue here is, per the CMake documentation:

The default target platform name (architecture) is Win32.

https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html

So currently the only way I can see to specify the target platform for the third-party build, at least when using the Visual Studio 2017 generator, is to specify Visual Studio 15 2017 Win64. However, that generator specification is mutually exclusive with the "modern cmake" -A x64 target specifier.

@ihnorton
Copy link
Author

Bump

Copy link
Contributor

@singku singku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me. Thank you. Will get it merged soon.

@singku
Copy link
Contributor

singku commented Jul 30, 2019

This has been merged.

@singku singku closed this Jul 30, 2019
@ihnorton ihnorton deleted the ihn/fix_cmake_platform_fwd branch July 30, 2019 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants