Skip to content

CMake Introduce CMake as the Primary Build System for MapWinGIS6 - #39

Open
pmeems wants to merge 1 commit into
developmentfrom
cmake-phase-0-audit
Open

pmeems wants to merge 1 commit into
developmentfrom
cmake-phase-0-audit

Conversation

@pmeems

@pmeems pmeems commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Phase 0 of the CMake migration plan: audit, decisions and parity tooling. No CMake targets yet.

Motivation

CMake must reproduce what MSBuild really does, including implicit defaults, and "no lost flags / no new warnings" must be measured rather than assumed. This PR records the baseline that every later CMake phase is compared against.

Changes

  • docs/CMAKE-MIGRATION.md: per-target sources, definitions, include directories, real link dependencies (hidden today by VcpkgAutoLink), generated MIDL files, custom build steps, runtime deployment, architecture-specific settings, hard-coded bin\<Config>\<Platform> paths, prerequisites, and decisions D1–D6.
  • build/scripts/Compare-CompileCommands.ps1: reads compile and link lines from a detailed MSBuild log (builds the .slnx itself when no log is given) and, optionally, from a CMake compile_commands.json plus a verbose build log. It normalises paths and option order, diffs per translation unit and per binary, counts unique warnings and summarises dumpbin /dependents /exports /headers. MSBuild is found through -MSBuild, MWG_MSBUILD, PATH, then vswhere.
  • .gitignore: out/, cmake-build-*/, CMakeUserPresets.json. The CMake vcpkg tree vcpkg_installed/cmake-<Platform> is already covered by vcpkg_installed/.
  • docs/BUILDING.md: short pointer to the migration doc and the parity script.

Key decisions

  • D1 CMake output goes to <binaryDir>/bin and <binaryDir>/lib, never to <repo>/bin. Preset dirs are short (out/b/x64d, ...). Scripts get an optional -BinDirectory later.
  • D2 CMake uses its own vcpkg tree per platform (vcpkg_installed/cmake-<Platform>), with triplets pinned in the presets.
  • D3 A single MapWinGIS.ActiveX.Interface target owns MIDL.
  • D4 Option (a): the six shared ActiveX sources are compiled twice, as today.
  • D5 The C# host gets a conditional ProjectReference (MwgCMakeBuild).
  • D6 Parity is measured with the script above.

Audit findings that correct the plan: no project defines WIN32, _WINDOWS or _USRDLL, so the CMake defaults get dropped. MSBuild adds _WINDLL to DLLs and /JMC in Debug. Every binary embeds a manifest (/TLBID:1). MIDL also gets /W1 /char signed /target "NT60". The MSBuild tests depend on gmock.dll only because of auto-linking.

Baseline (MSBuild, VS 18.11, MSVC 14.51, SDK 10.0.28000.0)

Debug x64 Release x64
TUs / links 42 / 4 42 / 4
Warnings 0 0
OCX exports 5 COM entry points incl. DllInstall same
DLL characteristics dynamic base, NX, high-entropy VA + CFG
Native tests 173 run, 170 passed, 3 skipped —

The Win32 baseline is collected in the phase that first builds Win32 with CMake.

Dependencies

Based on development. First PR of the CMake stack.

Co-authored-by: Junie <junie@jetbrains.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant