@@ -780,13 +780,8 @@ def run_cmake_configure(self, additional_args: Optional[List[str]] = None) -> No
780780 '-DBUILD_SHARED_LIBS=ON' , # Build as shared library on Unix
781781 ])
782782
783- # Windows-specific workaround for zlib resource compilation issue
783+ # Windows-specific: disable resource compilation if CMAKE_RC_COMPILER is not set
784784 if self .platform_name == 'Windows' :
785- # The RC compiler fails on win32/zlib1.rc due to C syntax in included headers
786- # Patch zlib CMakeLists.txt to disable the problematic shared library target
787- self ._patch_zlib_cmake_for_windows ()
788-
789- # Disable resource compilation entirely if CMAKE_RC_COMPILER is not set
790785 if not os .environ .get ('CMAKE_RC_COMPILER' ):
791786 cmake_cmd .extend (['-DCMAKE_RC_COMPILER=' ]) # Empty RC compiler disables resource compilation
792787
@@ -1477,8 +1472,8 @@ def copy_radiation_shader_files(self) -> None:
14771472 "The radiation plugin requires GPU backend shader files.\n "
14781473 "Shader files (SPIR-V for Vulkan, PTX for OptiX) should be generated during CMake build.\n \n "
14791474 "To fix this issue:\n "
1480- "1. Ensure Vulkan SDK is installed (primary cross-platform backend )\n "
1481- "2. Or ensure CUDA toolkit + OptiX are installed (NVIDIA-only backend)\n "
1475+ "1. Ensure Vulkan loader is installed (macOS/Linux; bundled on Windows )\n "
1476+ "2. Or ensure CUDA toolkit is installed (NVIDIA GPU backend)\n "
14821477 "3. Check CMake configuration enables at least one GPU backend\n "
14831478 "4. Run build with --clean to rebuild from scratch\n \n "
14841479 f"Expected shader directory: { shader_source_dir } \n "
@@ -1572,70 +1567,6 @@ def build(self, cmake_args: Optional[List[str]] = None) -> Path:
15721567 print (f"Built with plugins: { final_plugins } " )
15731568 return output_library
15741569
1575- def _patch_zlib_cmake_for_windows (self ) -> None :
1576- """
1577- Patch zlib's CMakeLists.txt on Windows to disable the shared library target
1578- that causes resource compilation errors with win32/zlib1.rc.
1579- """
1580- zlib_cmake_path = self .helios_root / "core" / "lib" / "zlib" / "CMakeLists.txt"
1581-
1582- if not zlib_cmake_path .exists ():
1583- print ("Warning: zlib CMakeLists.txt not found, skipping patch" )
1584- return
1585-
1586- print ("Patching zlib CMakeLists.txt to disable shared library on Windows..." )
1587-
1588- try :
1589- # Read the original file
1590- with open (zlib_cmake_path , 'r' ) as f :
1591- content = f .read ()
1592-
1593- # Check if already patched (to avoid double-patching)
1594- if "# PYHELIOS PATCH: Disabled shared library" in content :
1595- print ("zlib CMakeLists.txt already patched" )
1596- return
1597- except Exception as e :
1598- print (f"Warning: Failed to read zlib CMakeLists.txt: { e } " )
1599- return
1600-
1601- # Patch: comment out the shared library creation and related lines
1602- patches = [
1603- # Comment out the shared library creation
1604- ("add_library(zlib SHARED" , "# PYHELIOS PATCH: Disabled shared library\n # add_library(zlib SHARED" ),
1605- # Comment out the include directories for shared lib
1606- ("target_include_directories(zlib PUBLIC" , "# target_include_directories(zlib PUBLIC" ),
1607- # Comment out all properties for shared lib
1608- ("set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)" , "# set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)" ),
1609- ("set_target_properties(zlib PROPERTIES SOVERSION 1)" , "# set_target_properties(zlib PROPERTIES SOVERSION 1)" ),
1610- (" set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})" , " # set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})" ),
1611- (" set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)" , " set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z)" ),
1612- (" set_target_properties(zlib PROPERTIES LINK_FLAGS" , " # set_target_properties(zlib PROPERTIES LINK_FLAGS" ),
1613- (" set_target_properties(zlib PROPERTIES SUFFIX \" 1.dll\" )" , " # set_target_properties(zlib PROPERTIES SUFFIX \" 1.dll\" )" ),
1614- # Update install targets to exclude zlib shared library
1615- (" install(TARGETS zlib zlibstatic" , " install(TARGETS zlibstatic" ),
1616- # Add static runtime linking for zlib
1617- ("add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})" ,
1618- "add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})\n # PYHELIOS PATCH: Use static MSVC runtime\n if(MSVC)\n set_target_properties(zlibstatic PROPERTIES MSVC_RUNTIME_LIBRARY \" MultiThreaded$<$<CONFIG:Debug>:Debug>\" )\n endif()" ),
1619- # Disable problematic resource compilation
1620- ("if(NOT MINGW)\n set(ZLIB_DLL_SRCS\n win32/zlib1.rc # If present will override custom build rule below.\n )\n endif()" ,
1621- "# PYHELIOS PATCH: Disable resource compilation to avoid RC errors\n # if(NOT MINGW)\n # set(ZLIB_DLL_SRCS\n # win32/zlib1.rc # If present will override custom build rule below.\n # )\n # endif()" ),
1622- ]
1623-
1624- for old , new in patches :
1625- if old in content :
1626- content = content .replace (old , new )
1627- print (f" Patched: { old [:50 ]} ..." )
1628-
1629- # Write the patched file back
1630- try :
1631- with open (zlib_cmake_path , 'w' ) as f :
1632- f .write (content )
1633- print ("zlib CMakeLists.txt patched successfully" )
1634- except Exception as e :
1635- print (f"Warning: Failed to write patched zlib CMakeLists.txt: { e } " )
1636- raise HeliosBuildError (f"Could not patch zlib CMakeLists.txt: { e } " )
1637-
1638-
16391570def get_default_plugins () -> List [str ]:
16401571 """
16411572 Get the default set of plugins (only the currently integrated plugins).
0 commit comments