Feature/msvc#80
Conversation
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces support for building the core components and their dependencies on Windows with MSVC and CMake. To achieve this, every nc-build.sh shell script for third-party dependencies has been replaced with a cross-platform nc-build.py Python orchestration, and CMake files are reorganized to gate Unix-only flags behind if(UNIX)/if(NOT MSVC) and to add MSVC-specific defines (_UNICODE/UNICODE, /bigobj, Windows libraries, etc.). A new msvc_fix.h header undefines Windows API macros that conflict with codebase symbols, and common.cmake centralizes the 3rd-party install paths and find_package(Boost) setup.
Changes:
- Replaced shell-based 3rd-party fetch/build (ICU, OpenSSL, Boost, V8, harfbuzz, brotli, hyphen, md4c, socket.io, hunspell, katana/gumbo) with a Python orchestrator (
Common/3dParty/build_3rdparty.py) and per-dependencync-build.pyscripts using a sharedbuild_3rdparty_common.pyhelper. - Refactored ~30
CMakeLists.txtfiles to make Unix-only compile/link flags conditional, add MSVC equivalents (_UNICODE,/bigobj, Windows system libs,WINDOWS_EXPORT_ALL_SYMBOLS), and append adeclare_victory()post-build banner per target. - Converted
OfficeUtilsandlibxmlfrom standalone targets to reusable CMake functions (add_officeutils,add_libxml) invoked fromCommon/CMakeLists.txt, and switched WASM/Apple include paths to use install-dir variables.
Reviewed changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| common.cmake | Centralizes 3rd-party install dirs, Boost/ICU/V8/OpenSSL variables, MSVC vs GCC flag sets, and adds declare_victory helper. |
| CMakeLists.txt | Removes large commented-out artifact-copy block. |
| Apple/CMakeLists.txt | Switches to add_libxml/add_cpp_sources_from_dir_recurive; removes embedded OfficeUtils/librevenge file lists. |
| Common/CMakeLists.txt | Calls new add_officeutils/add_libxml functions; gates -include posix_compat.h behind non-MSVC. |
| Common/cfcpp/CMakeLists.txt | Adds declare_victory call. |
| Common/Network/CMakeLists.txt | Adds MSVC Windows libs (Crypt32, urlmon...) and FileTransporter_win.cpp path; fixes prior WIN_32 typo to MSVC. |
| Common/Network/WebSocket/src/socketio/socketio_internal_private*.h | Updates socketio header paths to new install dir layout. |
| Common/3dParty/*/nc-build.py (new) | Python rewrite of fetch/build for each dependency. |
| Common/3dParty/build_3rdparty.py, build_3rdparty_common.py | Orchestrator and shared helpers (workdir/install markers, run_command, shallow_checkout). |
| Common/3dParty/cryptopp/project/CMakeLists.txt | Switches Boost link to PUBLIC; drops copy_boost_libs. |
| Common/3dParty/hunspell/CMakeLists.txt | Sources from new install dir; adds declare_victory. |
| Common/3dParty/md/md2html.cpp | Updates md4c/src/... include to md/src/.... |
| Common/3dParty/v8/tools/8.9/x64-*/patch | Adds Windows toolchain patch; tweaks Linux cflags patch to skip when is_win. |
| msvc_fix.h (new) | Undefines GetCharWidth/CreateFile Windows API macros. |
| DesktopEditor/{xml,xmlsec,graphics,fontengine,pluginsmanager,allthemesgen,AllFontsGen,doctrenderer,...}/CMakeLists.txt | Replace ad-hoc execute_process-driven 3rd-party fetches with shared variables; add MSVC paths/defines; rename KATANA/GUMBO/HARFBUZZ/BROTLI/HYPHEN/ICU_INSTALL_DIR references to their _ABS counterparts; add declare_victory. |
| DesktopEditor/doctrenderer/CMakeLists.txt | Adds MSVC defines, Rpcrt4/Winmm/Dbghelp, gates pthread to Unix; changes a Boost link target. |
| DesktopEditor/xmlsec/src/CMakeLists.txt | Reworks to use shared OpenSSL vars; gates UNICODE handling to Unix; capitalizes Windows libs. |
| DesktopEditor/xml/build/cmake/CMakeLists.txt | Converts to add_libxml() function form. |
| OfficeUtils/CMakeLists.txt | Replaces target/library with add_officeutils() function. |
| OfficeUtils/js/CMakeLists.txt | Drops local C++ standard set; adds declare_victory. |
| PdfFile/CMakeLists.txt | Gates HAVE_UNISTD_H/FCNTL_H and -include limits to Unix; comments out Windows -UUNICODE block. |
| PdfFile/Resources/CMapMemory/CMakeLists.txt | Uses TARGET_FILE_NAME + cmake -E remove instead of hardcoded path/rm. |
| {OOXML,MsBinaryFile,Rtf,Txt,Odf,Hwp,Fb2,Html,Epub,Djvu,Xps,Ofd,DocxRenderer,X2t,X2tTester,UnicodeConverter}/.../CMakeLists.txt | Drop hardcoded vcpkg Boost root and explicit find_package(Boost); add MSVC _UNICODE/UNICODE defines and declare_victory. |
| X2tConverter/build/cmake/library/CMakeLists.txt | Removes inline ICU fetch; reorganizes source list; uses ${LIBICUUC}/${LIBICUDATA}. |
| OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt | Adds absolute paths, gates remove_definitions(-DUNICODE) to Unix, replaces SUPPORT_MS_CRYPTO block with STARMATH_USE_DYNAMIC_LIBRARY. |
| HwpFile/CMakeLists.txt | Adds StarMathConverter target dependency and link. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
…utput Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
|
I took a look at your third-party approach and think it’s generally good. I think we can simply integrate vcpkg independently of that once we upgrade the packages. (We’ll probably never be able to completely replace your approach with vcpkg anyway.)
Edit: I made some small fixes to the python script to make it work with python 3.10 on ubuntu 22.04. Shall i push them? |
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>
This PR makes it possible to build core components and their dependencies on Windows with MSVC and CMake.
To achieve this I've re-written all dependency building in python (
Common/3dParty/build_3rdparty.py). Atm this doesn't use vcpkg or any pre-built binaries at all. That is a "TODO".The setup on Windows is not the most straight forward. One needs:
I plan to document this exactly later.