← All tasks
cppzeux/pugixml #544Not a task: already works

v1.13 is linking to the dynamic MSVC runtime (dll) even if PUGIXML_STATIC_CRT is set to ON.

envgap__zeux__pugixml-544

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
f4b89469b341bf2c1c156838cf162172430267d3
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

zeux/pugixml #544 · read the original issue
We are building `pugixml` for Windows, linking against the static MSVC runtime. When using v1.9, we were simply setting `STATIC_CRT` to `ON`, and everything was working as expected.



With newer versions of `pugixml`, the CMake variable has been namespaced to `PUGIXML_STATIC_CRT`. Sadly, setting this variable to `ON` does not seem to link against the static RT.



Here is a minimal procedure to illustrate the issue:



* Clone and build pugixml 1.3 and request static runtime:

 

      git clone https://github.com/zeux/pugixml.git --branch v1.13 --depth 1

      cd pugixml

      mkdir build && cd build

      cmake -D PUGIXML_STATIC_CRT=ON ..

      cmake --build . --config Release



* Analyse the result:



      dumpbin /directives Release\pugixml.lib



We get the following output:



>    Linker Directives

>

>    /FAILIFMISMATCH:_MSC_VER=1900

>    /FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=0

>    /FAILIFMISMATCH:RuntimeLibrary=MD_DynamicRelease

>    /DEFAULTLIB:msvcprt

>    /FAILIFMISMATCH:_CRT_STDIO_ISO_WIDE_SPECIFIERS=0

>    /DEFAULTLIB:MSVCRT

>    /DEFAULTLIB:OLDNAMES



This indicates that it is linked against `MSVCRT`, which is the [DLL version of the MSVC runtime](https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170).



Are there other requirements to link to the static runtime, or is there an issue with the build procedure?
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]