Skip to content

[CMake] Name conflict causes a compile error #1241

Closed

Description

@SunBlack

When updating CMake 3.30.1 to 3.31.9 in the vcpkg repository (microsoft/vcpkg#48250), a compilation error occurred with this library here. The reason for the compile error is that vcpkg uses Ninja for compiling, which is highly parallelized. This can cause issues if two targets have the same name, as additional files, such as PDBs, are often created.

Here a library named qjs will be created

add_library(qjs ${qjs_sources})

And here the executable will be renamed to the same name

quickjs/CMakeLists.txt

Lines 305 to 307 in 6a9fe9a

set_target_properties(qjs_exe PROPERTIES
OUTPUT_NAME "qjs"
)

As qjs_exe doesn't link against qjs, assumes that it can be compiled in parallel - because of the same name, the compiler wants to create a PDB with the same name at the same time, which leads to the following issue:

LINK : fatal error LNK1201: error writing to program database 'D:\b\quickjs-ng\x64-windows-static-dbg\qjs.pdb'; check for insufficient disk space, invalid path, or insufficient privilege

The best solution would be to avoid renaming targets so that conflicts do not arise. In the vcpkg repository, we will rename the PDB file as a temporary patch, but this does not prevent possible issues arising from identical file names in other compilers.

Activity

  1. saghul commented on Nov 17, 2025

    @saghul
    Contributor

    As qjs_exe doesn't link against qjs

    But it does:

    target_link_libraries(qjs_exe qjs)

  2. mvanhorn commented on May 16, 2026

    @mvanhorn
    Contributor

    Implemented in #1474 - unique PDB_NAME per target so qjs and qjs_exe don't collide on Windows parallel builds.

  3. added a commit that references this issue on May 16, 2026
    3da8a4a
  4. added a commit that references this issue on May 20, 2026
    e83c4dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions