Skip to content

Commit 6f401bc

Browse files
fixes
1 parent 8acf1f5 commit 6f401bc

5 files changed

Lines changed: 30 additions & 6 deletions

File tree

.azure-pipelines/generate_windows_matrix_build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
configs = {}
1212
for platform, debug, uwp in product(PLATFORMS, (False,), TRUE_FALSE):
13+
# No need to support ARM/ARM64 except for UWP.
14+
if uwp and (platform.lower() == 'arm' or platform.lower() == 'arm64'):
15+
continue
16+
1317
label = [platform]
1418
config = []
1519
generator = VS_VERSION

src/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ include(GNUInstallDirs)
2626

2727
### Dependencies
2828
set(OpenGL_GL_PREFERENCE GLVND)
29-
find_package(OpenGL)
29+
if (NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
30+
# OpenGL package will be found for UWP apps but gl.h excludes UWP apps so it isn't actually usable.
31+
find_package(OpenGL)
32+
endif()
33+
3034
if(OPENGL_FOUND)
3135
add_definitions(-DXR_USE_GRAPHICS_API_OPENGL)
3236
message(STATUS "Enabling OpenGL support")
@@ -84,9 +88,13 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
8488
add_definitions(-DXR_OS_LINUX)
8589
endif()
8690

91+
# /EHsc (support for C++ exceptions) is default in most configurations but seems missing when building arm/arm64.
92+
IF(MSVC)
93+
SET(CMAKE_CXX_FLAGS "/EHsc")
94+
ENDIF(MSVC)
95+
8796
# This is a little helper library for setting up OpenGL
88-
if(OPENGL_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/gfxwrapper_opengl.c"
89-
AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
97+
if(OPENGL_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/gfxwrapper_opengl.c")
9098
add_library(openxr-gfxwrapper STATIC common/gfxwrapper_opengl.c common/gfxwrapper_opengl.h)
9199
target_include_directories(openxr-gfxwrapper PUBLIC ${PROJECT_SOURCE_DIR}/external/include)
92100
if(TARGET OpenGL::OpenGL)

src/tests/hello_xr/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
6969
target_compile_definitions(hello_xr PRIVATE _CRT_SECURE_NO_WARNINGS)
7070
target_compile_options(hello_xr PRIVATE /Zc:wchar_t /Zc:forScope /W4 /WX)
7171
endif()
72-
target_link_libraries(hello_xr d3d11 d3d12 d3dcompiler dxgi ${OPENGL_gl_LIBRARY})
72+
target_link_libraries(hello_xr d3d11 d3d12 d3dcompiler dxgi ole32)
73+
74+
if(OPENGL_FOUND)
75+
target_link_libraries(hello_xr ${OPENGL_gl_LIBRARY})
76+
endif()
7377
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
7478
target_compile_options(hello_xr PRIVATE -Wall)
7579
target_link_libraries(hello_xr m pthread)

src/tests/list/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ endif()
3737

3838
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
3939
target_compile_options(runtime_list PRIVATE /Zc:wchar_t /Zc:forScope /W4 /WX)
40-
target_link_libraries(runtime_list openxr_loader opengl32)
40+
target_link_libraries(runtime_list openxr_loader)
41+
if(OPENGL_FOUND)
42+
target_link_libraries(runtime_list ${OPENGL_gl_LIBRARY})
43+
endif()
4144
endif()
4245

4346
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")

src/tests/loader_test/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ endif()
4545
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
4646
target_compile_definitions(loader_test PRIVATE _CRT_SECURE_NO_WARNINGS)
4747
target_compile_options(loader_test PRIVATE /Zc:wchar_t /Zc:forScope /W4 /WX)
48-
target_link_libraries(loader_test openxr_loader opengl32 d3d11)
48+
target_link_libraries(loader_test openxr_loader d3d11)
49+
50+
if(OPENGL_FOUND)
51+
target_link_libraries(loader_test ${OPENGL_gl_LIBRARY})
52+
endif()
53+
4954
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
5055
target_compile_options(
5156
loader_test PRIVATE -Wall -Wno-unused-function -Wno-format-truncation

0 commit comments

Comments
 (0)