Skip to content
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

[gainput] imporve cmake search gainput library #11000

Merged
merged 14 commits into from
May 8, 2020

Conversation

L-Sun
Copy link
Contributor

@L-Sun L-Sun commented Apr 24, 2020

Describe the pull request

@msftclas
Copy link

msftclas commented Apr 24, 2020

CLA assistant check
All CLA requirements met.

@JackBoosY JackBoosY changed the title [gainput] imporve cmake search gainput library. [gainput] imporve cmake search gainput library Apr 26, 2020
@L-Sun L-Sun requested a review from JackBoosY April 26, 2020 04:11
Copy link
Contributor

@JackBoosY JackBoosY left a comment

Choose a reason for hiding this comment

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

gainput*.cmake is still generated in share/gainput. We should generate unofficial-gainput*.cmake in share/unofficial-gainput.
And set vcpkg_fixup_cmake_targets() to vcpkg_fixup_cmake_targets(CONFIG_PATH unofficial-gainput TARGET_PATH unofficial-gainput).
See example.

@L-Sun
Copy link
Contributor Author

L-Sun commented Apr 26, 2020

Thanks for giving a examples. I have modified the relevant code.

Copy link
Contributor

@JackBoosY JackBoosY left a comment

Choose a reason for hiding this comment

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

Dynamic build generated gainputstatic.lib. Can you confirm this?

@L-Sun
Copy link
Contributor Author

L-Sun commented Apr 27, 2020

This behavior existed before I modified the code. Should I modify it?

@JackBoosY
Copy link
Contributor

@L-Sun Yes, dynamic libraries can only be generated in dynamic triples, as are static libraries.

@L-Sun L-Sun requested a review from JackBoosY April 28, 2020 05:33
@L-Sun
Copy link
Contributor Author

L-Sun commented Apr 28, 2020

It has passed on x64_windows_static pipeline, so should we need update ci.baseline.txt with gainput:x64-windows-static=pass?

@JackBoosY
Copy link
Contributor

@L-Sun Just remove gainput:x64-windows-static=fail from ci.baseline.txt.

@JackBoosY
Copy link
Contributor

CMake Error at lib/CMakeLists.txt:58 (target_link_libraries):
  Cannot specify link libraries for target "gainput" which is not built by
  this project.

@L-Sun
Copy link
Contributor Author

L-Sun commented Apr 28, 2020

I don’t have an Apple device, so I can’t test in an osx environment. I have reset osx related code in
lib/CMakeLists.

@JackBoosY
Copy link
Contributor

In SOURCE/lib/CMakeLists.txt line 54:

elseif(APPLE)
...
        target_link_libraries(gainput ${FOUNDATION} ${IOKIT} ${GAME_CONTROLLER})

When using the triple x64-osx or x64-linux, the default library linkage is static, so it can only generate the target "gainputstatic", causing this error.

@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@JackBoosY JackBoosY left a comment

Choose a reason for hiding this comment

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

No, the baseline seems incorrect and not related with this PR.

@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label May 8, 2020
@JackBoosY
Copy link
Contributor

LGTM, thanks for this PR!

@strega-nil
Copy link
Contributor

Alright, this is cool! Thanks @L-Sun :)

@strega-nil strega-nil merged commit 6d3a3bc into microsoft:master May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants