diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-12-30 03:08:30 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-12-30 03:08:30 +0000 |
| commit | 612b2d67eb1b477b0bc3fc77c52cf37b1db8aa57 (patch) | |
| tree | a04df36971c54965c3eb5110a222d6b097fef28d /Graphics/GraphicsEngineMetal | |
| parent | Added Metal backend stub (diff) | |
| download | DiligentCore-612b2d67eb1b477b0bc3fc77c52cf37b1db8aa57.tar.gz DiligentCore-612b2d67eb1b477b0bc3fc77c52cf37b1db8aa57.zip | |
Enabled build of Metal backend stub
Diffstat (limited to 'Graphics/GraphicsEngineMetal')
| -rw-r--r-- | Graphics/GraphicsEngineMetal/CMakeLists.txt | 26 |
1 files changed, 24 insertions, 2 deletions
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 + # '<function name>' 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}) |
