From 612b2d67eb1b477b0bc3fc77c52cf37b1db8aa57 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 29 Dec 2018 19:08:30 -0800 Subject: Enabled build of Metal backend stub --- Graphics/GraphicsEngineMetal/CMakeLists.txt | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineMetal') diff --git a/Graphics/GraphicsEngineMetal/CMakeLists.txt b/Graphics/GraphicsEngineMetal/CMakeLists.txt index e3373c53..6a2bb29d 100644 --- a/Graphics/GraphicsEngineMetal/CMakeLists.txt +++ b/Graphics/GraphicsEngineMetal/CMakeLists.txt @@ -76,8 +76,9 @@ add_library(GraphicsEngineMetal-shared SHARED readme.md ) -# Set output name to GraphicsEngineMetal_{32|64}{r|d} -set_dll_output_name(GraphicsEngineMetal-shared GraphicsEngineMetal) +set_target_properties(GraphicsEngineMetal-shared PROPERTIES + OUTPUT_NAME GraphicsEngineMetal +) set_common_target_properties(GraphicsEngineMetal-shared) set_common_target_properties(GraphicsEngineMetal-static) @@ -87,12 +88,18 @@ PRIVATE include ) +find_library(METAL_FRAMEWORK Metal) +if (NOT METAL_FRAMEWORK) + message(FATAL_ERROR "Metal framework is not found") +endif() + target_link_libraries(GraphicsEngineMetal-static PRIVATE BuildSettings TargetPlatform Common GraphicsEngine + ${METAL_FRAMEWORK} PUBLIC GraphicsEngineMetalInterface ) @@ -100,6 +107,21 @@ PUBLIC target_link_libraries(GraphicsEngineMetal-shared PUBLIC GraphicsEngineMetal-static) target_compile_definitions(GraphicsEngineMetal-shared PUBLIC ENGINE_DLL=1) + +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_target_properties(GraphicsEngineMetal-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden +endif() + +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # Disable the following clang warning + # '' hides overloaded virtual function + # as hiding is intended + target_compile_options(GraphicsEngineMetal-static PRIVATE -Wno-overloaded-virtual) + target_compile_options(GraphicsEngineMetal-shared PRIVATE -Wno-overloaded-virtual) +endif() + + source_group("src" FILES ${SRC} ) source_group("include" FILES ${INCLUDE}) source_group("interface" FILES ${INTERFACE}) -- cgit v1.2.3