Skip to content

Commit

Permalink
fix from derived coder conan-io/conan#7192
Browse files Browse the repository at this point in the history
  • Loading branch information
matkonnerth committed Jul 11, 2022
1 parent b270f03 commit b4c1b80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions outputWrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ endif()
add_library(outputWrapper SHARED src/outputWrapper.cpp)
target_include_directories(outputWrapper PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(outputWrapper PRIVATE CONAN_PKG::output)
# The LD linker complains even about missing link of transitive dependencies,
# altough they are private and hidden (wrapper library)
# LD needs to see them. This would require for consumer to have find_package
# in cmake for transitive and private dependencies.
# which is not what we want. We can fix this with this workaround
target_link_options(outputWrapper PUBLIC "-Wl,--unresolved-symbols=ignore-in-shared-libs")

enable_testing()
add_subdirectory(tests)
5 changes: 4 additions & 1 deletion outputWrapper/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class OutputWrapperConan(ConanFile):
name = "outputWrapper"
requires = [("output/master@mk/testing", "private")]

generators = "cmake"
settings = "os", "compiler", "arch", "build_type"
license = "mk"
Expand All @@ -12,6 +12,9 @@ class OutputWrapperConan(ConanFile):
default_options = {"shared": True,
"fPIC": True}

def requirements(self):
self.requires("output/master@mk/testing", private=True)

def imports(self):
self.copy("*.so*", dst="lib", src="lib")

Expand Down

0 comments on commit b4c1b80

Please sign in to comment.