Fix asset lookup for multi-config generators#615
Open
AnouarMohamed wants to merge 2 commits intogoogle:mainfrom
Open
Fix asset lookup for multi-config generators#615AnouarMohamed wants to merge 2 commits intogoogle:mainfrom
AnouarMohamed wants to merge 2 commits intogoogle:mainfrom
Conversation
Use CMake's GENERATOR_IS_MULTI_CONFIG property when computing RELATIVE_PATH_TO_PROJECT_ROOT instead of checking only for Visual Studio. This fixes runtime asset lookup for generators like Ninja Multi-Config, where executables are placed under bin/<Config>/ and the previous logic computed a path that was one directory too shallow. Fixes google#563
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Member
|
Hi, Change LGTM, thanks for the contribution. Once you've signed the CLA we should be able to merge this. |
Author
|
Just signed the CLA and triggered a new CI run, should be good now! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
BigWheels computes
RELATIVE_PATH_TO_PROJECT_ROOTfrom the runtime outputdirectory so applications can find
assets/at runtime.That logic only treated Visual Studio as a multi-config generator. With
generators like
Ninja Multi-Config, executables are also emitted underbin/<Config>/, so the computed relative path is too shallow and samplesfail to locate assets at runtime.
Fixes #563
Solution
Use CMake's
GENERATOR_IS_MULTI_CONFIGglobal property instead of matchingonly
CMAKE_GENERATORagainst Visual Studio.This keeps the existing single-config behavior unchanged and correctly
accounts for all multi-config generators when deriving the path back to
the build root.
Testing
I could not run a full configure/build in this environment because
cmakewas not installed.
I did verify the path math for the affected layouts:
binresolves back to the build root with..bin/Debugresolves back to the build root with../..