-
Notifications
You must be signed in to change notification settings - Fork 263
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
Portability and Build System Cleanup #192
Conversation
@rpavlik I've tried your
|
And it built before with your branch? I'm very surprised you got it to build if CMake can't find threads. It is weird that all 4 filesystem checks failed. Can you attach I'm installing arch linux in a VM here so I can repro this locally, in theory, but I'm concerned that there are now 2 build breaks on your system (though, the lack of filesystem just falls back to raw file apis). |
Hmm, so I couldn't reproduce in Arch: had a very minimum install, but it found threads as well as std::filesystem (but only in experimental mode)
so more info on your environment, etc. would be very helpful. |
Of course it did :)
I see you use GCC 10 though. Here I use 9.3.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checks fail here because the -std=c++17
option isn't passed to the compiler.
src/cmake/StdFilesystemFlags.cmake
Outdated
set(_stdfs_test_source | ||
"bool is_reg_file(const std::string &path) { return fs::is_regular_file(path); } | ||
int main() { | ||
(void)is_reg_file(\"/etc/os-release\"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand this. Here CMake checks a file exists? I surely doesn't in my build chroot. Assuming /etc/os-release
exists everywhere doesn't seem correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is never actually run. This is just code I had previously used to reproduce an issue with the stdc++fs library not working, so I knew it doesn't link without the same things in STD:: filesystem that the loader uses. I just had to make sure it looked real enough so it wasn't getting optimized out.
Ok with this additional patch it builds here now with GCC 9.3.0 :)
|
OK, I updated it with more unsets :) |
Thanks @rpavlik ! I confirm this PR builds fine here with GCC 9.3.0 :) |
Great. I tried it on Visual Studio 2019, which was only partially succesful - it's not detecting the presence of filesystem. Turns out the ifdefs are more complex than I remembered. Think I will probably either pull all other commits from here into a separate PR, or put in a small bodge to avoid skipping std::fs usage in msvc until I have a chance to do it better. |
This should transparently identify when it's available in standard or experimental forms, as well as when it requires stdc++fs to be linked. MSVC was a bit weird to get working here, but eventually got it.
hello_xr D3D plugin requires DirectXColors which isn't in MinGW, so we must check for that too. Fixes build of hello_xr on MinGW
OK, got msvc working right now. Will merge once the CI passes. |
- Registry - Add an author ID, and reserve a vendor extension for Huawei. (OpenXR-Docs/#46) - Reserve vendor extensions for future LunarG overlay and input focus functionality. (internal MR 1720) - Reserve vendor extensions for Microsoft. (internal MR 1723) - Add XR_EXT_hand_tracking multi-vendor extension. (internal MR 1554, internal issue 1266, internal issue 1267, internal issue 1268, internal issue 1269) - Add XR_HUAWEI_controller_interaction vendor extension. (OpenXR-Docs/#47) - Add XR_MNDX_egl_enable provisional vendor extension. (OpenXR-Docs/#48) - Add XR_MSFT_spatial_graph_bridge vendor extension. (internal MR 1730) - Add XR_MSFT_secondary_view_configuration and XR_MSFT_first_person_observer vendor extensions. (internal MR 1731) - Add XR_MSFT_hand_mesh_tracking vendor extension. (internal MR 1736) - Fix missing space in XML definition of XrSpatialAnchorCreateInfoMSFT. (internal MR 1742, internal issue 1351, OpenXR-SDK-Source/#187) - Update a number of contacts for author/vendor tags. (internal MR 1788, internal issue 1326) - SDK - Replaced usage of the _DEBUG macro with NDEBUG. (internal MR 1756) - Allow disabling of std::filesystem usage via CMake, and detect if it’s available and what its requirements are. (OpenXR-SDK-Source/#192, OpenXR-SDK-Source/#188) - CI: Modifications to Azure DevOps build pipeline. Now builds UWP loader DLLs in addition to Win32 loader DLLs. No longer builds static loader libraries due to linkability concerns. Re-arranged release artifact zip to distinguish architecture from 32-bit or 64-bit. - Loader: Replace global static initializers with functions that return static locals. With this change, code that includes OpenXR doesn’t have to page in this code and initialize these during startup. (OpenXR-SDK-Source/#173) - Loader: Unload runtime when xrCreateInstance fails. (internal MR 1778) - Loader: Add “info”-level debug messages listing all the places that we look for the OpenXR active runtime manifest. (OpenXR-SDK-Source/#190) - Validation Layer: Fix crash in dereferencing a nullptr optional array handle when the count > 0. (internal MR 1709, OpenXR-SDK-Source/#161, internal issue 1322) - Validation Layer: Fix static analysis error and possible loss of validation error. (internal MR 1715, OpenXR-SDK-Source/#160, internal issue 1321) - Validation Layer: Simplify some generated code, and minor performance improvements. (OpenXR-SDK-Source/#176) - API Dump Layer: Fix crash in dereferencing a nullptr while constructing a std::string. (internal MR 1712, OpenXR-SDK-Source/#162, internal issue 1323) - hello_xr: Fix releasing a swapchain image with the incorrect image layout. (internal MR 1755) - hello_xr: Prefer VK_LAYER_KHRONOS_validation over VK_LAYER_LUNARG_standard_validation when available. (internal MR 1755) - hello_xr: Optimizations to D3D12 plugin to avoid GPU pipeline stall. (internal MR 1770) (OpenXR-SDK-Source/#175) - hello_xr: Fix build with Vulkan headers 1.2.136. (OpenXR-SDK-Source/#181, OpenXR-SDK-Source/#180, internal issue 1347) - hello_xr: Fix build with Visual Studio 16.6. (OpenXR-SDK-Source/#186, OpenXR-SDK-Source/#184)
- Registry - Add an author ID, and reserve a vendor extension for Huawei. (OpenXR-Docs/KhronosGroup#46) - Reserve vendor extensions for future LunarG overlay and input focus functionality. (internal MR 1720) - Reserve vendor extensions for Microsoft. (internal MR 1723) - Add XR_EXT_hand_tracking multi-vendor extension. (internal MR 1554, internal issue 1266, internal issue 1267, internal issue 1268, internal issue 1269) - Add XR_HUAWEI_controller_interaction vendor extension. (OpenXR-Docs/KhronosGroup#47) - Add XR_MNDX_egl_enable provisional vendor extension. (OpenXR-Docs/KhronosGroup#48) - Add XR_MSFT_spatial_graph_bridge vendor extension. (internal MR 1730) - Add XR_MSFT_secondary_view_configuration and XR_MSFT_first_person_observer vendor extensions. (internal MR 1731) - Add XR_MSFT_hand_mesh_tracking vendor extension. (internal MR 1736) - Fix missing space in XML definition of XrSpatialAnchorCreateInfoMSFT. (internal MR 1742, internal issue 1351, OpenXR-SDK-Source/KhronosGroup#187) - Update a number of contacts for author/vendor tags. (internal MR 1788, internal issue 1326) - SDK - Replaced usage of the _DEBUG macro with NDEBUG. (internal MR 1756) - Allow disabling of std::filesystem usage via CMake, and detect if it’s available and what its requirements are. (OpenXR-SDK-Source/KhronosGroup#192, OpenXR-SDK-Source/KhronosGroup#188) - CI: Modifications to Azure DevOps build pipeline. Now builds UWP loader DLLs in addition to Win32 loader DLLs. No longer builds static loader libraries due to linkability concerns. Re-arranged release artifact zip to distinguish architecture from 32-bit or 64-bit. - Loader: Replace global static initializers with functions that return static locals. With this change, code that includes OpenXR doesn’t have to page in this code and initialize these during startup. (OpenXR-SDK-Source/KhronosGroup#173) - Loader: Unload runtime when xrCreateInstance fails. (internal MR 1778) - Loader: Add “info”-level debug messages listing all the places that we look for the OpenXR active runtime manifest. (OpenXR-SDK-Source/KhronosGroup#190) - Validation Layer: Fix crash in dereferencing a nullptr optional array handle when the count > 0. (internal MR 1709, OpenXR-SDK-Source/KhronosGroup#161, internal issue 1322) - Validation Layer: Fix static analysis error and possible loss of validation error. (internal MR 1715, OpenXR-SDK-Source/KhronosGroup#160, internal issue 1321) - Validation Layer: Simplify some generated code, and minor performance improvements. (OpenXR-SDK-Source/KhronosGroup#176) - API Dump Layer: Fix crash in dereferencing a nullptr while constructing a std::string. (internal MR 1712, OpenXR-SDK-Source/KhronosGroup#162, internal issue 1323) - hello_xr: Fix releasing a swapchain image with the incorrect image layout. (internal MR 1755) - hello_xr: Prefer VK_LAYER_KHRONOS_validation over VK_LAYER_LUNARG_standard_validation when available. (internal MR 1755) - hello_xr: Optimizations to D3D12 plugin to avoid GPU pipeline stall. (internal MR 1770) (OpenXR-SDK-Source/KhronosGroup#175) - hello_xr: Fix build with Vulkan headers 1.2.136. (OpenXR-SDK-Source/KhronosGroup#181, OpenXR-SDK-Source/KhronosGroup#180, internal issue 1347) - hello_xr: Fix build with Visual Studio 16.6. (OpenXR-SDK-Source/KhronosGroup#186, OpenXR-SDK-Source/KhronosGroup#184)
I've extracted some changes from another PR where I'm hitting issues, in hopes of merging all but the really tricky stuff.
Highlights: