Skip to content

Fix for forced libiconv in non Visual Studio environments #1

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

Open
wants to merge 1 commit into
base: testing/3.2.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ def configure(self):
del self.options.with_null
del self.options.with_zlib # zlib and png are always used in nmake build,
del self.options.with_png # and it's not trivial to fix
else:
del self.options.with_libiconv
if self.options.get_safe("with_libdeflate") and not self.options.get_safe("with_zlib", True):
raise ConanInvalidConfiguration("gdal:with_libdeflate=True requires gdal:with_zlib=True")
self._strict_options_requirements()
Expand Down Expand Up @@ -617,7 +615,10 @@ def _configure_autotools(self):
args.append("--with-libz={}".format("yes" if self.options.with_zlib else "no"))
if self._has_with_libdeflate_option:
args.append("--with-libdeflate={}".format("yes" if self.options.with_libdeflate else "no"))
args.append("--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)))
if self.options.with_libiconv:
args.append("--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)))
else:
args.append("--without-libiconv-prefix")
Comment on lines +618 to +621
Copy link
Owner

@SpaceIm SpaceIm Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.options.with_libiconv:
args.append("--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)))
else:
args.append("--without-libiconv-prefix")
args.append("--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath) if self.options.with_libiconv else "no"))

can be simplified in one line

Copy link
Author

@jtorresfabra jtorresfabra Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you actually need to be verbose in disabling it. Meaning explicitely call "without-libiconv-prefix".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--with-libiconv-prefix=no should be the same than --without-libiconv-prefix

args.append("--with-liblzma=no") # always disabled: liblzma is an optional transitive dependency of gdal (through libtiff).
args.append("--with-zstd={}".format("yes" if self.options.get_safe("with_zstd") else "no")) # Optional direct dependency of gdal only if lerc lib enabled
# Drivers:
Expand Down