-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Make sure vcpkg_test_cmake uses the correct generator #5635
Conversation
set(GENERATOR ${_tc_GENERATOR}) | ||
else() | ||
# vcpkg_configure_cmake defines _VCPKG_CMAKE_GENERATOR when called | ||
set(GENERATOR ${_VCPKG_CMAKE_GENERATOR}) |
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.
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.
Indeed, that's why the content of GENERATOR is tested later on.
I'll update the comment to make this more explicit.
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.
Quote from a discussion about this with ras0219:
We should always use ninja here (and skip it for 32-bit hosts). There's no reason to use the MSBuild generator, nor for it to be configurable. This is because all generators should work.
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.
Thanks for taking a look at this PR!
I agree with the latest part of the comment. But I don't get the rational for the very first part: why skip 32bits? and why ninja only?
The very first intent of my commit is, by using the same generator, that we target the same platform/architecture: the breakage on my side is that the package is generated for x64 but is searched for by an x86 generator.
But indeed, reusing the same generator might not be the way to go. Maybe just enforcing the architecture could be sufficient first step (I don't know if ninja generator supports -A flag).
Note that in a general case, it seems to me that find_package logic will be mostly independent of the generator used (when try_compile/link/run are not used at least).
@@ -4,7 +4,7 @@ | |||
## | |||
## ## Usage: | |||
## ```cmake | |||
## vcpkg_test_cmake(PACKAGE_NAME <name> [MODULE]) | |||
## vcpkg_test_cmake(PACKAGE_NAME <name> [MODULE] [GENERATOR generator]) |
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.
Would be nice if targets could also be tested
Hi @tarcila Thanks for your contribution! I'll run a test against all packages, as it looks like this PR slightly changes the default behavior of calling Our
We are aware of the design flaws in it and we are planning on designing a better CMake integration test mechanism in the future. |
I do confirm that the default behavior is changed when the package is generated using
Noted. I'll drop |
Looks like a similar change sneaked its way throug in PR #5574 Can you solve the conflicts and add the changes to manually specify the generator? |
Sure, will do.
Le ven. 15 mars 2019 à 17:40, Victor Romero <notifications@github.com> a
écrit :
… Looks like a similar change sneaked its way throug in PR #5574
<#5574>
Can you solve the conflicts and add the changes to manually specify the
generator?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5635 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIOFX3bQeu9Y0J7m1nyB8v-aBQ9S-z3ks5vXBNngaJpZM4bpNm6>
.
|
Otherwise, on Windows, it will default to x86 based generator that will fail finding x64 builds. For instance, when building for x64-windows: CMake Error at CMakeLists.txt:4 (find_package): Could not find a configuration file for package "CapnProto" that is compatible with requested version "". The following configuration files were considered but not accepted: vcpkg/packages/capnproto_x64-windows/share/capnproto/CapnProtoConfig.cmake, version: 0.7.0 (64bit)
45945e6
to
08a3951
Compare
@vicroms I have rebased the PR on top of the latest master. |
Integration test is failing for now because of microsoft#5630 and microsoft#5635 This at least makes the package function on Windows x86 and x64.
Due to multiple issues with vcpkg_test_cmake() it has been disabled. A new CMake integration test solution will be designed, but for the time being that's still in our backlog. |
Otherwise, on Windows, it will default to x86 based generator that will
fail finding x64 builds. For instance, when building for x64-windows:
CMake Error at CMakeLists.txt:4 (find_package):
Could not find a configuration file for package "CapnProto" that is
compatible with requested version "".
The following configuration files were considered but not accepted: