Skip to content

Commit c2c04ab

Browse files
committed
Fix logic.
1 parent c63855d commit c2c04ab

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ option(MATERIALX_BUILD_GEN_MSL "Build the MSL shader generator back-end." ON)
4545
option(MATERIALX_BUILD_GEN_SLANG "Build the Slang shader generator back-end." ON)
4646
option(MATERIALX_BUILD_RENDER "Build the MaterialX Render modules." ON)
4747
option(MATERIALX_BUILD_RENDER_PLATFORMS "Build platform-specific render modules for each shader generator." ON)
48-
option(MATERIALX_RENDER_MSL_ONLY "On macOS, render with Metal Shading Language only (disables GLSL rendering)." OFF)
48+
option(MATERIALX_RENDER_MSL_ONLY "On macOS, use Metal Shading Language only for tests and viewer (skips GLSL render tests)." OFF)
4949
option(MATERIALX_BUILD_OIIO "Build OpenImageIO support for MaterialXRender." OFF)
5050
option(MATERIALX_BUILD_OCIO "Build OpenColorIO support for shader generators." OFF)
5151
option(MATERIALX_BUILD_TESTS "Build unit tests." OFF)
@@ -121,7 +121,7 @@ if(MATERIALX_RENDER_MSL_ONLY)
121121
if(NOT MATERIALX_BUILD_GEN_MSL)
122122
message(FATAL_ERROR "MATERIALX_RENDER_MSL_ONLY requires MATERIALX_BUILD_GEN_MSL to be enabled")
123123
endif()
124-
message(STATUS "MSL-only rendering mode enabled - GLSL rendering will be disabled")
124+
message(STATUS "MSL-only testing mode enabled - MaterialXTest will not link MaterialXRenderGlsl")
125125
endif()
126126

127127
# All hardware shading languages currently depend on the GLSL shader generator.
@@ -515,11 +515,8 @@ if(MATERIALX_BUILD_RENDER)
515515
if(MATERIALX_BUILD_RENDER_PLATFORMS)
516516
set(MATERIALX_BUILD_RENDER_HW OFF)
517517
if(MATERIALX_BUILD_GEN_GLSL AND NOT MATERIALX_BUILD_APPLE_EMBEDDED)
518-
# Skip GLSL rendering on macOS if MSL-only mode is enabled
519-
if(NOT (APPLE AND MATERIALX_RENDER_MSL_ONLY))
520-
set(MATERIALX_BUILD_RENDER_HW ON)
521-
add_subdirectory(source/MaterialXRenderGlsl)
522-
endif()
518+
set(MATERIALX_BUILD_RENDER_HW ON)
519+
add_subdirectory(source/MaterialXRenderGlsl)
523520
endif()
524521
if(MATERIALX_BUILD_GEN_MSL AND APPLE)
525522
set(MATERIALX_BUILD_RENDER_HW ON)
@@ -539,12 +536,7 @@ if(MATERIALX_BUILD_RENDER)
539536
add_subdirectory(source/MaterialXView)
540537
endif()
541538
if(MATERIALX_BUILD_GRAPH_EDITOR)
542-
# Graph Editor currently requires GLSL rendering
543-
if(APPLE AND MATERIALX_RENDER_MSL_ONLY)
544-
message(WARNING "MaterialXGraphEditor requires GLSL rendering and will not be built when MATERIALX_RENDER_MSL_ONLY is enabled on macOS")
545-
else()
546-
add_subdirectory(source/MaterialXGraphEditor)
547-
endif()
539+
add_subdirectory(source/MaterialXGraphEditor)
548540
endif()
549541
if(MATERIALX_INSTALL_RESOURCES AND NOT SKBUILD)
550542
add_subdirectory(resources)

source/MaterialXTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ endif()
6969
if(MATERIALX_BUILD_RENDER)
7070
add_subdirectory(MaterialXRender)
7171
target_link_libraries(MaterialXTest MaterialXRender)
72-
if(MATERIALX_BUILD_GEN_GLSL)
72+
if(MATERIALX_BUILD_GEN_GLSL AND NOT MATERIALX_RENDER_MSL_ONLY)
7373
add_subdirectory(MaterialXRenderGlsl)
7474
target_link_libraries(MaterialXTest MaterialXRenderGlsl)
7575
endif()

0 commit comments

Comments
 (0)