Skip to content

Commit

Permalink
(#4274) [libdispatch] fix linking order on Linux
Browse files Browse the repository at this point in the history
* [libdispatch] fix linking order on Linux

* remove validations

* just Clang

* explicit cpp_info.libs

* syntax fix

* addresses some PR comments

* adds librt to system_libs
  • Loading branch information
fpelliccioni authored Jan 19, 2021
1 parent 572ff44 commit 48789c6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions recipes/libdispatch/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class LibDispatchConan(ConanFile):
_cmake = None

def validate(self):
if self.settings.build_type != "Release":
raise ConanInvalidConfiguration("Just Release builds allowed.")

if self.settings.compiler != "clang":
raise ConanInvalidConfiguration("Clang compiler is required.")

Expand Down Expand Up @@ -58,6 +55,12 @@ def package(self):
tools.rmdir(os.path.join(self.package_folder, "share"))

def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
if self.settings.os == "Macos":
self.cpp_info.libs = ["dispatch"]
else:
self.cpp_info.libs = ["dispatch", "BlocksRuntime"]

if self.settings.os == "Linux":
self.cpp_info.system_libs = ["pthread"]
self.cpp_info.system_libs = ["pthread", "rt"]
elif self.settings.os == "Windows":
self.cpp_info.system_libs = ["ShLwApi", "WS2_32", "WinMM", "synchronization"]

0 comments on commit 48789c6

Please sign in to comment.