Skip to content

multiple rules generate zstd.lib #2248

@tobq

Description

@tobq

Building on windows with cmake > ninja > clang (> msvc) leads to the duplicate generation error

cmake-build-debug> cmake -G Ninja ..

-- The C compiler identification is Clang 10.0.0 with GNU-like command-line
-- The CXX compiler identification is Clang 10.0.0 with GNU-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
[...]
-- CMAKE_INSTALL_LIBDIR: lib
-- ZSTD_LEGACY_SUPPORT not defined!
-- ZSTD_MULTITHREAD_SUPPORT is enabled
-- Configuring done
-- Generating done
CMake Error:
  Running

   'C:/STANDALONE-BINARIES/ninja.exe' '-C' 'cmake-build-debug' '-t' 'cleandead'

  failed with:

   ninja: error: build.ninja:6103: multiple rules generate libs/zstd/build/cmake/lib/zstd.lib [-w dupbuild=err]

CMake Error:
  Running

   'C:/STANDALONE-BINARIES/ninja.exe' '-C' 'cmake-build-debug' '-t' 'recompact'

  failed with:

   ninja: error: build.ninja:6103: multiple rules generate libs/zstd/build/cmake/lib/zstd.lib [-w dupbuild=err]

CMake Generate step failed.  Build files cannot be regenerated correctly.

CMakeLists.txt

[...]
add_subdirectory(libs/zstd/build/cmake)
target_link_libraries(${TargetName} PRIVATE libzstd_static)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions