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

[googleapis] Use is_msvc to abstract away compiler name setting #14626

Merged
Merged
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
4 changes: 3 additions & 1 deletion recipes/googleapis/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

from conan import ConanFile
from conan.tools.files import get, copy
from conan.tools.microsoft import is_msvc
from conan.tools.scm import Version

from conan.errors import ConanInvalidConfiguration

from helpers import parse_proto_libraries

required_conan_version = ">=1.45.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
required_conan_version = ">=1.45.0"
required_conan_version = ">=1.47.0"

Copy link
Contributor

Choose a reason for hiding this comment

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

due to ConanInvalidConfiguration from conan.errors


class GoogleAPIS(ConanFile):
name = "googleapis"
Expand Down Expand Up @@ -55,7 +57,7 @@ def validate(self):
if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5":
raise ConanInvalidConfiguration("Build with GCC 5 fails")

if self.settings.compiler in ["Visual Studio", "msvc"] and self.options.shared:
if is_msvc(self) and self.options.shared:
raise ConanInvalidConfiguration("Source code generated from protos is missing some export macro")
if self.options.shared and not self.options["protobuf"].shared:
raise ConanInvalidConfiguration("If built as shared, protobuf must be shared as well. Please, use `protobuf:shared=True`")
Expand Down