Fix build of Metal examples when also building GL

This fixes the build when trying to build both the Metal examples
and the GL examples in the same build. The change is an unfortunate
consequence of how dependencies are bundled together in
examples/common and a future task is needed to split up these
dependencies.  The same workaround exists in the DirectX examples as
well and would also benefit from splitting up the dependencies.
This commit is contained in:
George ElKoura 2019-03-09 22:58:34 -08:00
parent 6ff680f34e
commit 0f2dd41f0a
2 changed files with 14 additions and 0 deletions

View File

@ -61,6 +61,13 @@ else()
set_source_files_properties("${BUNDLE_FILES}" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif()
# XXX: This is unfortunate, we should probably refactor examples_common_obj
# to separate out the GL from the Metal dependencies so that we don't end up
# in the situation where we have to link in GLFW for mtlViewer.
if (GLFW_FOUND)
list(APPEND PLATFORM_LIBRARIES "${GLFW_LIBRARIES}")
endif()
include_directories(
"${OPENSUBDIV_INCLUDE_DIR}"
"${METAL_INCLUDE_DIR}"

View File

@ -60,6 +60,13 @@ else()
set_source_files_properties("${BUNDLE_FILES}" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif()
# XXX: This is unfortunate, we should probably refactor examples_common_obj
# to separate out the GL from the Metal dependencies so that we don't end up
# in the situation where we have to link in GLFW for mtlViewer.
if (GLFW_FOUND)
list(APPEND PLATFORM_LIBRARIES "${GLFW_LIBRARIES}")
endif()
include_directories(
"${OPENSUBDIV_INCLUDE_DIR}"
"${METAL_INCLUDE_DIR}"