-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
If two packages depend on another package, the build will fail.
or
Call find_package() more than once for the same package
To Reproduce
Steps to reproduce the behavior:
- export library from vcpkg:
./vcpkg install boost-endian:arm-android boost-endian:arm64-android boost-endian:x86-android boost-endian:x64-android
./vcpkg export --triplet x64-android boost-endian --prefab --prefab-maven --prefab-debug
add implementation 'com.vcpkg.ndk.support:boost-endian:1.75.0' in app/build.gradle - click build in android studio
or
- CMakeLists.txt
find_package(asio CONFIG REQUIRED)
find_package(asio CONFIG REQUIRED)
- click build in android studio
Expected behavior
Build success.
Logs
> Task :app:generateJsonModelDebug FAILED
Execution failed for task ':app:generateJsonModelDebug'.
> /mnt/local/.../app/src/main/cpp/CMakeLists.txt : C/C++ debug|armeabi-v7a : CMake Error at /mnt/local/.../app/.cxx/cmake/debug/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/boost-compatibility/boost-compatibilityConfig.cmake:1 (add_library):
add_library cannot create imported target
"boost-compatibility::boost-compatibility" because another target with the
same name already exists.
Call Stack (most recent call first):
/mnt/local/.../app/.cxx/cmake/debug/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/boost-config/boost-configConfig.cmake:1 (find_package)
/mnt/local/.../app/.cxx/cmake/debug/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/boost-core/boost-coreConfig.cmake:1 (find_package)
/mnt/local/.../app/.cxx/cmake/debug/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/boost-endian/boost-endianConfig.cmake:3 (find_package)
.../CMakeLists.txt:11 (find_package)
Environment:
Prefab version: 1.1.2
Additional context
In generated * Config.cmake needs target guard.
eg
if(NOT TARGET $target)
add_library($target ...)
set_target_properties($target ...)
endif()
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working