cad-native
Native DWG-to-DXF-group-code sidecar. It reads a DWG with LibreDWG's C API and writes a DXF pair stream to stdout.
It does not call dwg_write_dxf; the existing buildCadScene consumes the output unchanged.
- LibreDWG: GNU official 0.14 stable source
- Source archive SHA256:
62ebb73b984f865960f20ed26619ea5f8789d5e3fd088fa40a2598384da81275 - The corresponding source archive is shipped as
libredwg-0.14.tar.xzin this directory for GPL compliance. - License: GPL-3.0-or-later (LibreDWG); this sidecar source is GPL-3.0-or-later as a derivative work.
- The sidecar is built natively on each platform. Do not cross-compile with MinGW: macOS uses Clang, Windows uses MSVC.
Build LibreDWG 0.14
Use the official source from https://ftp.gnu.org/gnu/libredwg/libredwg-0.14.tar.xz.
macOS / Linux
tar -xJf libredwg-0.14.tar.xz
cd libredwg-0.14
./configure --prefix="$PWD/install" --disable-shared --enable-static \
--disable-bindings --disable-docs --disable-python \
--disable-dxf --disable-json --disable-write --disable-werror --disable-dependency-tracking
make -j4
The static library is src/.libs/libredwg.a.
Windows (MSVC / CMake)
Build the same LibreDWG 0.14 source with CMake and MSVC (no MinGW), producing redwg.lib.
The upstream source ships a CMake build; keep DEBUG_CLASSES enabled if the Windows build needs complete DWG object coverage.
Build the sidecar
macOS / Linux
bash build-macos.sh /path/to/libredwg-0.14 # or build-linux.sh
Windows (MSVC, no MinGW)
Use the official libredwg-0.14-win64.zip from the LibreDWG 0.14 release. The script generates a
MSVC import library from the official DLL with dumpbin/lib, compiles the sidecar with CMake +
Visual Studio 2022, and copies libredwg-0.dll and its runtime DLLs beside the executable:
.\build-windows.ps1 -LibreDwgWin64Zip C:\path\to\libredwg-0.14-win64.zip
The sidecar links the static MSVC CRT (CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded). It must not
depend on VCRUNTIME140.dll or the UCRT: end-user machines without the VC++ 2015-2022
Redistributable would fail to start it at load time (exit 0xC0000135, no stderr). The build script
verifies the dependency table with dumpbin /dependents and fails on any MSVC/UCRT runtime DLL.
The build scripts write the result to the platform directory:
- macOS:
native/darwin-arm64/cad-nativeornative/darwin-x64/cad-native - Linux:
native/linux-x64/cad-native - Windows:
native/win32-x64/cad-native.exe(plus the runtime DLLs in the same directory)
@customize-agent/knowledge depends on this package and resolves native/<platform>-<arch>/cad-native inside it; CUSTOMIZE_CAD_NATIVE_BINARY can override the path for tests.