From 381e7b120d243be14fdb55bfc06c9accbafdbda5 Mon Sep 17 00:00:00 2001 From: Colin Cornaby Date: Sun, 7 Apr 2024 21:12:14 -0700 Subject: [PATCH] Work in progress on moving shaders into library --- Sources/Plasma/Apps/plClient/CMakeLists.txt | 2 -- .../Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt | 12 ++++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index 804c597f42..c4de6fc31b 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -151,7 +151,6 @@ if(APPLE) XCODE_ATTRIBUTE_MTL_ENABLE_DEBUG_INFO[variant=RelWithDebInfo] "INCLUDE_SOURCE" XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES" XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=RelWithDebInfo] "YES" - XCODE_ATTRIBUTE_MTL_HEADER_SEARCH_PATHS "${Plasma_SOURCE_DIR}/Sources/Plasma/NucleusLib/inc/" XCODE_ATTRIBUTE_INSTALL_PATH "/Applications" XCODE_ATTRIBUTE_SKIP_INSTALL "NO" XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/Mac-Cocoa/plClient.entitlements" @@ -238,7 +237,6 @@ target_link_libraries( $<$:pfDXPipeline> $<$:pfGLPipeline> $<$:pfMetalPipeline> - $<$:pfMetalPipelineShaders> CURL::libcurl "$<$:-framework Cocoa>" "$<$:-framework QuartzCore>" diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt index 6454b6cb17..696bd9458b 100644 --- a/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt @@ -59,7 +59,7 @@ target_include_directories(pfMetalPipeline PUBLIC "ShaderSrc") source_group("Source Files" FILES ${pfMetalPipeline_SOURCES}) source_group("Header Files" FILES ${pfMetalPipeline_HEADERS}) -add_library(pfMetalPipelineShaders INTERFACE) +add_library(pfMetalPipelineShaders MODULE) set(pfMetalPipeline_SHADERS ShaderSrc/FixedPipelineShaders.metal ShaderSrc/PlateShaders.metal @@ -75,8 +75,12 @@ set(pfMetalPipeline_SHADERS ShaderSrc/GammaCorrection.metal ShaderSrc/TextFontShader.metal ) -set_source_files_properties(${pfMetalPipeline_SHADERS} TARGET_DIRECTORY plClient PROPERTIES LANGUAGE METAL) -# source group does not work with an interface library in Xcode, but maybe someday... +set_target_properties(pfMetalPipelineShaders PROPERTIES + XCODE_PRODUCT_TYPE com.apple.product-type.metal-library + XCODE_ATTRIBUTE_MTL_HEADER_SEARCH_PATHS "${Plasma_SOURCE_DIR}/Sources/Plasma/NucleusLib/inc/" + SUFFIX ".metallib" +) +set_source_files_properties(${pfMetalPipeline_SHADERS} TARGET_DIRECTORY pfMetalPipelineShaders PROPERTIES LANGUAGE METAL) source_group("Metal Shaders" FILES ${pfMetalPipeline_SHADERS}) -target_sources(pfMetalPipelineShaders INTERFACE ${pfMetalPipeline_SHADERS}) +target_sources(pfMetalPipelineShaders PRIVATE ${pfMetalPipeline_SHADERS})