Skip to content

Fix asset lookup for multi-config generators#615

Open
AnouarMohamed wants to merge 2 commits intogoogle:mainfrom
AnouarMohamed:fix-multiconfig-asset-path
Open

Fix asset lookup for multi-config generators#615
AnouarMohamed wants to merge 2 commits intogoogle:mainfrom
AnouarMohamed:fix-multiconfig-asset-path

Conversation

@AnouarMohamed
Copy link
Copy Markdown

Problem

BigWheels computes RELATIVE_PATH_TO_PROJECT_ROOT from the runtime output
directory 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 under
bin/<Config>/, so the computed relative path is too shallow and samples
fail to locate assets at runtime.

Fixes #563

Solution

Use CMake's GENERATOR_IS_MULTI_CONFIG global property instead of matching
only CMAKE_GENERATOR against 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 cmake
was not installed.

I did verify the path math for the affected layouts:

  • single-config bin resolves back to the build root with ..
  • multi-config bin/Debug resolves back to the build root with ../..

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
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 22, 2026

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.

@Keenuts
Copy link
Copy Markdown
Member

Keenuts commented Apr 23, 2026

Hi,

Change LGTM, thanks for the contribution. Once you've signed the CLA we should be able to merge this.

@AnouarMohamed
Copy link
Copy Markdown
Author

Just signed the CLA and triggered a new CI run, should be good now!

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.

Projects can't find assets when built using "Ninja Multi-config" CMake generator

2 participants