KhronosGroup / OpenXR-SDK-Source

Sources for OpenXR loader, basic API layers, and example code.
https://khronos.org/openxr
Apache License 2.0
680 stars 251 forks source link

Windows loader uses dynamic MSVCRT by default #436

Open gboccone-qcom opened 12 months ago

gboccone-qcom commented 12 months ago

The comments on line 220-221 say one thing but this line is doing something else:

Edit: I've read the comment again, it seems to be fine, probably a misunderstanding on my side. However the default build behavior has changed, and we are using a dynamic MSVCRT for the static build. I don't know if this is the right thing to do. Changing the following line from AND NOT to OR NOT fixed my issue but it's probably the wrong approach.

https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/33c4600cda9cd7689a2452c2251d8e5df0765d0e/src/loader/CMakeLists.txt#L208

rpavlik commented 12 months ago

Yes, that's why this release hasn't been announced yet, having the .def inside that condition is breaking UWP builds, I have a hotfix pending for it. It shouldn't change the default behavior, though...

For whatever reason, I understood the old and current behavior to be:

I do not know why exactly this is the way but I think that the Microsoft people were the ones who recommended it.

gboccone-qcom commented 12 months ago

I see. In my case, I was using the default static lib build, but I could link my application with static loader and static crt.

Now I get an error when I try to link because the loader requires the dynamic crt and the application is configured to use static.

It's not just default, it's the only option available.

rpavlik-bot commented 11 months ago

An issue (number 2159) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#2159 ), to facilitate working group processes.

This GitHub issue will continue to be the main site of discussion.