Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[leveldb] build failure #23099

Closed
imtiazShakil opened this issue Feb 15, 2022 · 0 comments · Fixed by #23126
Closed

[leveldb] build failure #23099

imtiazShakil opened this issue Feb 15, 2022 · 0 comments · Fixed by #23126
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@imtiazShakil
Copy link

Host Environment

  • OS: Windows 10 Pro, version: 20H2, Windows Feature Experience Pack 120.2212.4170.0
  • Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30140 for x64

To Reproduce

Install leveldb using

.\vcpkg.exe install leveldb:x64-windows-static

After that I created a very simple hello world project that just prints "HelloWorld". My build fails when linking leveldb::leveldb. Below is my CMakeLists.txt file.

# CMakeList.txt : CMake project for testleveldb, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.18)

project ("testleveldb")

# Add source to this project's executable.
add_executable (testleveldb "testleveldb.cpp" "testleveldb.h")

# TODO: Add tests and install targets if needed.
find_package(leveldb CONFIG REQUIRED)
target_link_libraries(testleveldb PRIVATE leveldb::leveldb)

And here is my CMakeSettings.json

{
  "configurations": [
    {
      "name": "x64-Debug",
      "generator": "Ninja",
      "configurationType": "Debug",
      "inheritEnvironments": [ "msvc_x64_x64" ],
      "buildRoot": "${projectDir}\\out\\build\\${name}",
      "installRoot": "${projectDir}\\out\\install\\${name}",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "variables": [
        {
          "name": "CMAKE_TOOLCHAIN_FILE",
          "value": "${env.HOMEPATH}/vcpkg/scripts/buildsystems/vcpkg.cmake"
        },
        {
          "name": "VCPKG_TARGET_TRIPLET",
          "value": "x64-windows-static"
        }
      ]
    }
  ]
}

Failure logs
When I try to build the project using visual studio 2019 this is what I get

1> [CMake] -- Configuring done
1> [CMake] CMake Error at /Users/xyz/vcpkg/scripts/buildsystems/vcpkg.cmake:558 (_add_executable):
1> [CMake]   Target "testleveldb" links to target "Threads::Threads" but the target was
1> [CMake]   not found.  Perhaps a find_package() call is missing for an IMPORTED
1> [CMake]   target, or an ALIAS target is missing?
1> [CMake] Call Stack (most recent call first):
1> [CMake]   CMakeLists.txt:9 (add_executable)
1> [CMake] -- Generating done
1> [CMake] CMake Generate step failed.  Build files cannot be regenerated correctly.

Additional context
I've tested with

  • cmake-3.20.21032501-MSVC_2
  • cmake-3.22.2-windows-x86_64

In both situation I got the same result.

@LilyWangLL LilyWangLL added requires:repro The issue is not currently repro-able category:port-bug The issue is with a library, which is something the port should already support and removed requires:repro The issue is not currently repro-able labels Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants