Skip to content
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

fix glib compilation with msvc-clang #10029

Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 15 additions & 2 deletions recipes/glib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ class GLibConan(ConanFile):
generators = "pkg_config"

@property
def _is_clang_cl(self):
return self.settings.os == 'Windows' and self.settings.compiler == 'clang'
AndreyMlashkin marked this conversation as resolved.
Show resolved Hide resolved

@property
def _is_msvc(self):
return self.settings.compiler == "Visual Studio" or self.settings.compiler == "msvc"

def validate(self):
if hasattr(self, 'settings_build') and tools.cross_building(self, skip_x64_x86=True):
raise ConanInvalidConfiguration("Cross-building not implemented")
if tools.Version(self.version) >= "2.69.0" and not self.options.with_pcre:
raise ConanInvalidConfiguration("option glib:with_pcre must be True for glib >= 2.69.0")

AndreyMlashkin marked this conversation as resolved.
Show resolved Hide resolved
def _source_subfolder(self):
return "source_subfolder"

Expand Down Expand Up @@ -176,7 +189,7 @@ def build(self):
self._patch_sources()
with tools.environment_append(
VisualStudioBuildEnvironment(self).vars
) if is_msvc(self) else tools.no_op():
) if self._is_msvc or self._is_clang_cl else tools.no_op():
AndreyMlashkin marked this conversation as resolved.
Show resolved Hide resolved
meson = self._configure_meson()
meson.build()

Expand All @@ -192,7 +205,7 @@ def package(self):
self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder)
with tools.environment_append(
VisualStudioBuildEnvironment(self).vars
) if is_msvc(self) else tools.no_op():
) if self._is_msvc or self._is_clang_cl else tools.no_op():
AndreyMlashkin marked this conversation as resolved.
Show resolved Hide resolved
meson = self._configure_meson()
meson.install()
self._fix_library_names()
Expand Down