Skip to content

Commit 8ac2bf6

Browse files
Fix ZLib build error on Windows.
1 parent c044d4d commit 8ac2bf6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/internal/build_openColorIO_windows64.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ SET MMSOLVER_OCIO_NAMESPACE="OpenColorIO_mmSolver"
140140
%SOURCE_ROOT%
141141
IF errorlevel 1 GOTO failed_to_generate_cpp
142142

143+
:: Build ZLIB explicitly before the rest of OpenColorIO.
144+
::
145+
:: On Windows, OpenColorIO's external project dependency graph can
146+
:: suffer from a race condition where 'minizip-ng_install' starts
147+
:: compiling before 'ZLIB_install' has finished installing headers to
148+
:: 'ext/dist/include'. This leaves minizip-ng unable to find 'zlib.h'.
149+
::
150+
:: By building ZLIB first we guarantee the headers are in place before
151+
:: any dependent target needs them.
152+
%CMAKE_EXE% --build . --target ZLIB_install
153+
IF errorlevel 1 GOTO failed_to_build_cpp
154+
143155
%CMAKE_EXE% --build . --parallel
144156
IF errorlevel 1 GOTO failed_to_build_cpp
145157

0 commit comments

Comments
 (0)