Commit 0915ceb for stable-diffusion.cpp
commit 0915ceba368f3413fd964639d7a23843795b59a9
Author: leejet <leejet714@gmail.com>
Date: Tue Dec 1 01:59:57 2026 +0800
fix: disable precompiled headers for SYCL builds
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34bed64..c50ae80 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -471,7 +471,8 @@ target_include_directories(${SD_LIB} PUBLIC include)
target_include_directories(${SD_LIB} PRIVATE src src/core "${CMAKE_CURRENT_BINARY_DIR}/generated")
target_include_directories(${SD_LIB} PUBLIC thirdparty)
target_compile_features(${SD_LIB} PUBLIC c_std_11 cxx_std_17)
-if(SD_BUILD_PCH)
+# oneAPI 2025.x cannot bundle precompiled headers when -fsycl is enabled.
+if(SD_BUILD_PCH AND NOT SD_SYCL)
set(SD_PCH_HEADERS ${SD_LIB_SOURCES})
list(FILTER SD_PCH_HEADERS INCLUDE REGEX "[.]hpp$")
list(FILTER SD_PCH_HEADERS EXCLUDE REGEX "/tokenizers/vocab/")
diff --git a/docs/build.md b/docs/build.md
index 3cb50cd..9d65ead 100644
--- a/docs/build.md
+++ b/docs/build.md
@@ -428,7 +428,8 @@ By default, the stable-diffusion C++ library precompiles the JSON header
and the project `.hpp` headers in the library source list to speed up
clean builds. Editing a header used by the PCH rebuilds the PCH and the
C++ files that use it. To disable it, add `-DSD_BUILD_PCH=OFF` to your
-configure command.
+configure command. SYCL builds skip the PCH because oneAPI 2025.x cannot
+bundle it with `-fsycl`.
To compare uncached clean builds, pass `-DGGML_CCACHE=OFF`,
`-DCMAKE_C_COMPILER_LAUNCHER=`, and `-DCMAKE_CXX_COMPILER_LAUNCHER=` in both