From 8acfe39e4c654f8a2dbb2179b3da7ded3fc396df Mon Sep 17 00:00:00 2001 From: Tom van Dijk <18gatenmaker6@gmail.com> Date: Mon, 12 May 2025 20:44:58 +0200 Subject: [PATCH] feat(docker): Use parallel compilation --- docker/Dockerfile | 4 ++++ docker/entrypoint.sh | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b9c5ff56..6d6e5286 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,6 +18,10 @@ RUN unzip cmake-3.26.6-windows-i386.zip -d ~/.wine/drive_c RUN mv ~/.wine/drive_c/cmake-3.26.6-windows-i386 ~/.wine/drive_c/cmake RUN rm cmake-3.26.6-windows-i386.zip +RUN wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip +RUN unzip ninja-win.zip -d ~/.wine/drive_c +RUN rm ninja-win.zip + # Set up entrypoint script to perform the build COPY entrypoint.sh entrypoint.sh RUN chmod +x entrypoint.sh diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 2bd88684..11d3e3ec 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -3,17 +3,20 @@ # Populate the Windows path inside of the wineprefix # TODO: This is in here because writing to the registry seems # to fail when performed in the Dockerfile itself; investigate -wine reg ADD 'HKCU\Environment' /v PATH /d 'C:\msvc\bin;C:\msvc\bin\winnt;C:\cmake\bin;C:\windows\system32' /f +wine reg ADD 'HKCU\Environment' /v PATH /d 'C:\msvc\bin;C:\msvc\bin\winnt;C:\cmake\bin;C:\windows\system32;C:\' /f wine reg ADD 'HKCU\Environment' /v INCLUDE /d 'C:\msvc\include;C:\msvc\mfc\include' /f wine reg ADD 'HKCU\Environment' /v LIB /d 'C:\msvc\lib;C:\msvc\mfc\lib' /f wine reg ADD 'HKCU\Environment' /v TMP /d 'Z:\build' /f wine reg ADD 'HKCU\Environment' /v TEMP /d 'Z:\build' /f # Configure build with CMake -wine cmake -B build isle -G "NMake Makefiles" $CMAKE_FLAGS +wine cmake -B build isle -G "Ninja" $CMAKE_FLAGS # Start compiling LEGO Island -wine cmake --build build +if [ "x$JOBS" = "x" ]; then + JOBS=$(nproc) +fi +wine cmake --build build --parallel $JOBS # Unlock directories chmod -R 777 isle build