Skip to content

Commit df47d5e

Browse files
aegioscycursoragent
andcommitted
cmake: add /bigobj for MSVC (fixes C1128 on stable-diffusion.cpp)
With the LTX-2 additions, the stable-diffusion.cpp translation unit exceeds MSVC's COFF 2^16 section limit and fails to compile on Windows with fatal error C1128. /bigobj raises the limit; clang/gcc are unaffected. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a7f646d commit df47d5e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ if (MSVC)
1616
$<$<COMPILE_LANGUAGE:C>:/utf-8>
1717
$<$<COMPILE_LANGUAGE:CXX>:/MP>
1818
$<$<COMPILE_LANGUAGE:CXX>:/utf-8>
19+
# stable-diffusion.cpp is a large translation unit; with the LTX-2
20+
# additions it exceeds the COFF 2^16 section limit, so MSVC needs
21+
# /bigobj (clang/gcc have no equivalent limit). Fatal error C1128.
22+
$<$<COMPILE_LANGUAGE:C>:/bigobj>
23+
$<$<COMPILE_LANGUAGE:CXX>:/bigobj>
1924
)
2025
endif()
2126

0 commit comments

Comments
 (0)