Skip to content

fix library search path for "static" feature with multi-configuration CMake generators - #232

Merged
Ralith merged 1 commit into
Ralith:masterfrom
Timbals:windows-search-path
Nov 14, 2026
Merged

Ralith merged 1 commit into
Ralith:masterfrom
Timbals:windows-search-path

Conversation

@Timbals

@Timbals Timbals commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

#231 changed the CMake build to use the "openxr_loader" target instead of the "install" target. That means the library is no longer copied to the "{dst}/lib" directory.

The search path was also changed from "{dst}/lib" to "{dst}/build/src/loader". But when using CMake with a multi-configuration generator the configuration name is appended, so the library is placed into "{dst}/build/src/loader/Release" with those generators.


Alternatively I also considered defining the CMAKE_ARCHIVE_OUTPUT_DIRECTORY environment variable, using a CMake generator expression:

.define(
    "CMAKE_ARCHIVE_OUTPUT_DIRECTORY",
    // CMake generator expression to prevent multi-configuration generators placing libraries into sub directories
    format!("$<1:{}>", out_dir.display()),
)

Maybe I will try adding the "static" feature to CI (#10) soon, as this would have been caught by the windows build.

… CMake generators

Ralith#231 changed the CMake build to use the "openxr_loader" target instead of the "install" target. That means the library is no longer copied to the "{dst}/lib" directory.

The search path was also changed from "{dst}/lib" to "{dst}/build/src/loader". But when using CMake with a multi-configuration generator the configuration name is appended, so the library is placed into "{dst}/build/src/loader/Release" with those generators.

@Ralith Ralith left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks!

@Ralith
Ralith merged commit 18f4872 into Ralith:master Nov 14, 2026
6 checks passed
@Timbals
Timbals deleted the windows-search-path branch November 14, 2026 00:57
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