Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4 from djrtl/disable-readline-edit-libs
Browse files Browse the repository at this point in the history
Fix cross-compilation for iOS and possibly other platforms
  • Loading branch information
solvingj committed Nov 3, 2018
2 parents 012a3a1 + cd07b8e commit 35a02bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
7 changes: 6 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def configure_cmake(self):
cmake.definitions["PCRE_BUILD_PCRECPP"] = self.options.build_pcrecpp
cmake.definitions["PCRE_SUPPORT_LIBZ"] = self.options.with_zlib
cmake.definitions["PCRE_SUPPORT_LIBBZ2"] = self.options.with_bzip2
cmake.definitions["PCRE_SUPPORT_LIBREADLINE"] = False
cmake.definitions["PCRE_SUPPORT_LIBEDIT"] = False
if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio":
cmake.definitions["PCRE_STATIC_RUNTIME"] = not self.options.shared and "MT" in self.settings.compiler.runtime
cmake.configure(build_folder=self.build_subfolder)
Expand All @@ -83,4 +85,7 @@ def package(self):
cmake.install()

def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
if self.settings.os == "Windows" and self.settings.build_type == 'Debug':
self.cpp_info.libs = ['pcreposixd', 'pcred']
else:
self.cpp_info.libs = ['pcreposix', 'pcre']
19 changes: 10 additions & 9 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ def build(self):
cmake.build()

def test(self):
with tools.environment_append(RunEnvironment(self).vars):
bin_path = os.path.join("bin", "test_package")
arguments = "%sw+ Bincrafters" % ("\\" if self.settings.os == "Windows" else "\\\\")
if self.settings.os == "Windows":
self.run("%s %s" % (bin_path, arguments))
elif self.settings.os == "Macos":
self.run("DYLD_LIBRARY_PATH=%s %s %s" % (os.environ.get('DYLD_LIBRARY_PATH', ''), bin_path, arguments))
else:
self.run("LD_LIBRARY_PATH=%s %s %s" % (os.environ.get('LD_LIBRARY_PATH', ''), bin_path, arguments))
if not tools.cross_building(self.settings):
with tools.environment_append(RunEnvironment(self).vars):
bin_path = os.path.join("bin", "test_package")
arguments = "%sw+ Bincrafters" % ("\\" if self.settings.os == "Windows" else "\\\\")
if self.settings.os == "Windows":
self.run("%s %s" % (bin_path, arguments))
elif self.settings.os == "Macos":
self.run("DYLD_LIBRARY_PATH=%s %s %s" % (os.environ.get('DYLD_LIBRARY_PATH', ''), bin_path, arguments))
else:
self.run("LD_LIBRARY_PATH=%s %s %s" % (os.environ.get('LD_LIBRARY_PATH', ''), bin_path, arguments))

0 comments on commit 35a02bf

Please sign in to comment.