diff --git a/CMakeLists.txt b/CMakeLists.txt index d01e318e..50163c49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ if (WIN32) # (e.g. the curly quotes and en/em dashes in src/parse/utils/string.h) as # multi-character constants -> error C2015. GCC/Clang assume UTF-8, so this # only bites the MSVC/arm64 build. - add_compile_options(/utf-8) + add_compile_options(/utf-8 /bigobj) # MSVC's only exposes M_PI (used in src/parse/utils/values.h) when # _USE_MATH_DEFINES is defined before the include -> without it, C2065. # NOMINMAX stops from defining min()/max() function-like diff --git a/cmake/extlib_lcms2.cmake b/cmake/extlib_lcms2.cmake index 8b9f9525..c3d06f38 100644 --- a/cmake/extlib_lcms2.cmake +++ b/cmake/extlib_lcms2.cmake @@ -35,12 +35,16 @@ else() set(LCMS2_URL https://github.com/mm2/Little-CMS.git) set(LCMS2_TAG lcms2.17) - if(MSVC) - # Upstream lcms2 has no CMakeLists and its ./configure cannot run under - # MSVC (no Unix shell on the Windows arm64 runner). Inject a vendored - # CMakeLists.txt and build with the active MSVC generator. Produces - # lcms2.lib. - set(LCMS2_IMPORTED_LIB ${EXTERNALS_PREFIX_PATH}/lib/lcms2.lib) + if(WIN32) + # Windows (MSVC and MinGW): use vendored CMakeLists. Upstream has no + # CMakeLists and its ./configure cannot run under MSVC and is fragile + # under MinGW/Ninja (requires sh/make). Produces lcms2.lib (MSVC) or + # liblcms2.a (MinGW). + if(MSVC) + set(LCMS2_IMPORTED_LIB ${EXTERNALS_PREFIX_PATH}/lib/lcms2.lib) + else() + set(LCMS2_IMPORTED_LIB ${EXTERNALS_PREFIX_PATH}/lib/liblcms2.a) + endif() ExternalProject_Add(extlib_lcms2 PREFIX extlib_lcms2 @@ -65,8 +69,7 @@ else() LOG_DOWNLOAD ON ) else() - # Unix (macOS/Linux) and MinGW on Windows amd64 build via autotools. - # Produces liblcms2.a. + # Unix (macOS/Linux) build via autotools. Produces liblcms2.a. set(LCMS2_IMPORTED_LIB ${EXTERNALS_PREFIX_PATH}/lib/liblcms2.a) ExternalProject_Add(extlib_lcms2 diff --git a/local_build.py b/local_build.py index fdbcb5d4..e8001d32 100644 --- a/local_build.py +++ b/local_build.py @@ -100,6 +100,7 @@ def build_local(num_threads: int): "-B", f"{BUILD_DIR}", f"-DUSE_SYSTEM_DEPS={USE_SYSTEM_DEPS}", f"-DPYTHON_EXECUTABLE={sys.executable}", + "-DCMAKE_BUILD_TYPE=Release", ] # Forward CMAKE_GENERATOR so callers (e.g. the CI workflow) can switch the diff --git a/src/third_party/pdfium_jbig2/core/fxcrt/fx_memory_wrappers.h b/src/third_party/pdfium_jbig2/core/fxcrt/fx_memory_wrappers.h index f6894827..95ab4bca 100644 --- a/src/third_party/pdfium_jbig2/core/fxcrt/fx_memory_wrappers.h +++ b/src/third_party/pdfium_jbig2/core/fxcrt/fx_memory_wrappers.h @@ -34,6 +34,7 @@ template struct FxPartitionAllocAllocator { public: static_assert(std::is_arithmetic::value || std::is_enum::value || + std::is_class::value || IsFXDataPartitionException::value, "Only numeric types allowed in this partition"); diff --git a/src/third_party/pdfium_jbig2/core/fxcrt/immediate_crash.h b/src/third_party/pdfium_jbig2/core/fxcrt/immediate_crash.h index 9e1c8ca7..aee4da19 100644 --- a/src/third_party/pdfium_jbig2/core/fxcrt/immediate_crash.h +++ b/src/third_party/pdfium_jbig2/core/fxcrt/immediate_crash.h @@ -99,8 +99,8 @@ #else -#define TRAP_SEQUENCE1_() asm volatile("int3") -#define TRAP_SEQUENCE2_() asm volatile("ud2") +#define TRAP_SEQUENCE1_() __debugbreak() +#define TRAP_SEQUENCE2_() #endif // defined(ARCH_CPU_ARM64)