Move EMotionFX's OpenGL dependency to 3rd Party and make sure Mac builds successfully

This commit is contained in:
amzn-sj
2021-04-15 10:42:34 -07:00
parent ebebc05cd1
commit a81ca4490f
6 changed files with 40 additions and 13 deletions
-6
View File
@@ -68,12 +68,6 @@ ly_add_target(
)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
find_package(OpenGL QUIET REQUIRED)
# Imported targets (like OpenGL::GL) are scoped to a directory. Add a
# a global scope
add_library(3rdParty::OpenGLInterface INTERFACE IMPORTED GLOBAL)
target_link_libraries(3rdParty::OpenGLInterface INTERFACE OpenGL::GL)
ly_add_target(
NAME EMotionFX.Editor.Static STATIC
@@ -13,10 +13,4 @@
# based on the active platform
# NOTE: functions in cmake are global, therefore adding functions to this file
# is being avoided to prevent overriding functions declared in other targets platfrom
# specific cmake files
target_compile_definitions(3rdParty::OpenGLInterface
INTERFACE
# MacOS 10.14 deprecates OpenGL. This silences the warnings for now.
GL_SILENCE_DEPRECATION
)
# specific cmake files
+21
View File
@@ -0,0 +1,21 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
find_package(OpenGL QUIET REQUIRED)
# Imported targets (like OpenGL::GL) are scoped to a directory. Add a
# a global scope
add_library(3rdParty::OpenGLInterface INTERFACE IMPORTED GLOBAL)
target_link_libraries(3rdParty::OpenGLInterface INTERFACE OpenGL::GL)
set(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/OpenGLInterface_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
if(EXISTS ${pal_file})
include(${pal_file})
endif()
+16
View File
@@ -0,0 +1,16 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
target_compile_definitions(3rdParty::OpenGLInterface
INTERFACE
# MacOS 10.14 deprecates OpenGL. This silences the warnings for now.
GL_SILENCE_DEPRECATION
)
+1
View File
@@ -15,6 +15,7 @@ set(FILES
Clang_mac.cmake
DirectXShaderCompiler_mac.cmake
FbxSdk_mac.cmake
OpenGLInterface_mac.cmake
OpenSSL_mac.cmake
Wwise_mac.cmake
)
+1
View File
@@ -18,6 +18,7 @@ set(FILES
Finddyad.cmake
FindFbxSdk.cmake
Findlibav.cmake
FindOpenGLInterface.cmake
FindOpenSSL.cmake
FindRadTelemetry.cmake
FindVkValidation.cmake