Skip to content

Commit

Permalink
Fix XR header include and don't build XRInterface.cpp if XR is disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Sep 25, 2023
1 parent c909152 commit 60ee7f3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
9 changes: 7 additions & 2 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,14 @@ elseif(ANDROID OR OHOS)
cocos/platform/java/modules/SystemWindow.h
cocos/platform/java/modules/SystemWindowManager.cpp
cocos/platform/java/modules/SystemWindowManager.h
cocos/platform/java/modules/XRInterface.cpp
cocos/platform/java/modules/XRInterface.h
)

if(USE_XR)
cocos_source_files(
cocos/platform/java/modules/XRInterface.cpp
cocos/platform/java/modules/XRInterface.h
)
endif()
endif()

if(ANDROID)
Expand Down
2 changes: 1 addition & 1 deletion native/cocos/core/Root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "platform/interfaces/modules/IScreen.h"
#include "platform/interfaces/modules/ISystemWindow.h"
#include "platform/interfaces/modules/ISystemWindowManager.h"
#include "platform/java/modules/XRInterface.h"
#include "platform/java/modules/IXRInterface.h"
#if CC_USE_DEBUG_RENDERER
#include "profiler/DebugRenderer.h"
#endif
Expand Down
3 changes: 3 additions & 0 deletions native/cocos/platform/android/AndroidPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
#include "platform/java/modules/SystemWindow.h"
#include "platform/java/modules/SystemWindowManager.h"
#include "platform/java/modules/Vibrator.h"

#if CC_USE_XR
#include "platform/java/modules/XRInterface.h"
#endif

#include "base/StringUtil.h"
#include "engine/EngineEvents.h"
Expand Down
2 changes: 1 addition & 1 deletion native/cocos/renderer/gfx-gles3/GLES3Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "GLES3Swapchain.h"
#include "GLES3Texture.h"
#include "application/ApplicationManager.h"
#include "platform/java/modules/XRInterface.h"
#include "platform/java/modules/IXRInterface.h"
#include "profiler/Profiler.h"
#include "states/GLES3GeneralBarrier.h"
#include "states/GLES3Sampler.h"
Expand Down
2 changes: 1 addition & 1 deletion native/cocos/scene/Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "math/Mat4.h"
#include "math/Vec3.h"
#include "math/Vec4.h"
#include "platform/java/modules/XRInterface.h"
#include "platform/java/modules/IXRInterface.h"
#include "renderer/gfx-base/GFXDef-common.h"
#include "renderer/pipeline/Define.h"

Expand Down
2 changes: 1 addition & 1 deletion native/cocos/xr/XRRemotePreviewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "base/std/container/unordered_map.h"
#include "base/std/container/vector.h"
#include "math/Quaternion.h"
#include "platform/java/modules/XRInterface.h"
#include "platform/java/modules/IXRInterface.h"

#if CC_USE_XR
#include "Xr.h"
Expand Down

0 comments on commit 60ee7f3

Please sign in to comment.