Skip to content

Commit

Permalink
Fix a compiler preprocessing issue in glPlatformContextDarwin.mm that…
Browse files Browse the repository at this point in the history
… popped up after rebasing on latest dev
  • Loading branch information
dgovil committed Sep 11, 2024
1 parent 70e7008 commit bb98ff8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
5 changes: 4 additions & 1 deletion cmake/defaults/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ if(APPLE)
MESSAGE(STATUS "Setting PXR_BUILD_USD_TOOLS=OFF because they are not supported on Apple embedded platforms")
set(PXR_BUILD_USD_TOOLS OFF)
endif()
set(PXR_ENABLE_GL_SUPPORT OFF)
endif ()
endif()

Expand All @@ -68,6 +67,10 @@ option(PXR_ENABLE_METAL_SUPPORT "Enable Metal based components" "${pxr_enable_me
option(PXR_ENABLE_VULKAN_SUPPORT "Enable Vulkan based components" OFF)
option(PXR_ENABLE_GL_SUPPORT "Enable OpenGL based components" ON)

if (PXR_APPLE_EMBEDDED)
set(PXR_ENABLE_GL_SUPPORT OFF)
endif ()

# Precompiled headers are a win on Windows, not on gcc.
set(pxr_enable_pch "OFF")
if(MSVC)
Expand Down
8 changes: 4 additions & 4 deletions pxr/imaging/garch/glPlatformContextDarwin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#include "glPlatformContextDarwin.h"

#if defined(PXR_GL_SUPPORT_ENABLED)
#ifdef ARCH_OS_OSX
#import <AppKit/NSOpenGL.h>
typedef NSOpenGLContext NSGLContext;
#elif defined ARCH_OS_IPHONE
#ifdef ARCH_OS_IPHONE
#import <UIKit/UIKit.h>
typedef EAGLContext NSGLContext;
#else
#import <AppKit/NSOpenGL.h>
typedef NSOpenGLContext NSGLContext;
#endif
#else
typedef void* NSGLContext;
Expand Down
13 changes: 5 additions & 8 deletions pxr/imaging/glf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ set(PXR_PACKAGE glf)
if (NOT ${PXR_ENABLE_GL_SUPPORT})
message(STATUS
"Building minimal ${PXR_PACKAGE} because PXR_ENABLE_GL_SUPPORT is OFF")
if (NOT PXR_APPLE_EMBEDDED)
list(APPEND optionalLibs OpenGL::GL)
endif()
else ()
list(APPEND optionalLibs ${X11_LIBRARIES})
if (TARGET OpenGL::GL)
list(APPEND optionalLibs OpenGL::GL)
endif()
endif ()

if (TARGET OpenGL::GL)
list(APPEND optionalLibs OpenGL::GL)
endif()

set(optionalPublicClasses "")
if (X11_FOUND)
list(APPEND optionalLibs ${X11_LIBRARIES})
list(APPEND optionalPublicClasses testGLContext)
endif()

Expand Down

0 comments on commit bb98ff8

Please sign in to comment.