-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add imagl/0.2.1 #4630
Add imagl/0.2.1 #4630
Changes from 1 commit
e9078dd
8376ef5
34a13cf
e12e215
109a45e
a391575
906a478
a5c8d70
37ea45e
4c90e58
1345d65
e2ad08a
5028584
065ea9b
4932cd9
12c9114
e49ff9c
eaa0681
376bd3e
da8f340
055e6a9
36707d3
ae26a9a
0fd9fe3
e2bcef8
a416447
0dcdf20
3476bcb
0aab732
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,20 @@ class ImaglConan(ConanFile): | |
description = "A lightweight library to load image for OpenGL application." | ||
topics = ("opengl", "texture", "image") | ||
settings = "os", "compiler", "build_type", "arch" | ||
options = {"shared": [True, False], "fPIC": [True, False], "with_png": [True, False], "with_jpeg": [True, False], "allow_clang_11": [True, False]} | ||
default_options = {"shared": False, "fPIC": True, "with_png": True, "with_jpeg": True, "allow_clang_11": False} | ||
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
"with_png": [True, False], | ||
"with_jpeg": [True, False], | ||
"allow_clang_11": [None, True, False] | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"with_png": True, | ||
"with_jpeg": True, | ||
"allow_clang_11": None | ||
} | ||
generators = "cmake" | ||
exports_sources = "CMakeLists.txt" | ||
_cmake = None | ||
|
@@ -103,10 +115,14 @@ def config_options(self): | |
del self.options.with_jpeg | ||
if not str(self.settings.compiler) == "clang" or not str(self.settings.compiler.version) == "11": | ||
del self.options.allow_clang_11 | ||
else: | ||
self.output.warn("allow_clang_11 option will be removed in the future when conan center index will support clang 11.") | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
if not self.settings.compiler.cppstd: | ||
self.settings.compiler.cppstd = "20" | ||
|
||
def requirements(self): | ||
if self.options.with_png: | ||
|
@@ -117,10 +133,31 @@ def requirements(self): | |
def _configure_cmake(self): | ||
if self._cmake: | ||
return self._cmake | ||
|
||
# CMake generator must be set to Ninja when using Visual Studio to let choose the right | ||
# MSVC compiler version when multiple versions are installed on build machine. The problem | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The lingo I am most familiar with is "MSVC toolsets" and yes CMake which takes "VS2019" as an arg always chooses the highest one installed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion, "MSVC toolset" is more often understood as the main version of toolset (140 for VS2013, 141 for VS2017 and 142 for VS2019). This is why I wanted to be explicit about the version of the compiler (the "142" toolset includes the 14.2x versions of the toolset, each version of which contains the MSVC compiler in version 19.2x ...). |
||
# with default generator is that it will always choose the last MSVC version. It will | ||
# generate Visual Studio solution and project files, and use MSBuild to build it. I think | ||
# it's a "feature" of CMake / Visual Studio generator that does not use environment which | ||
# is set by vcvars. So if you want to use a specific MSVC version, you have to use Ninja | ||
# generator with CMake. You can find some side explanation here: | ||
# https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2019/ | ||
# | ||
# Building with specific MSVC version could be needed since imaGL requires some minimal | ||
# version to be compiled according to its own version. Following table links imaGL version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this required for the build to pass on CCI? In the Conan universe if you want to build an exact toolset you could use the new msvc compiler. (this is consistent with CMake) Just as a sanity check, Is this required ? Or is it an improvement? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's not required to pass on CCI. By the way, CCI is not able to build imaGL since I do this in the recipe to allow imaGL to be built locally in a Visual Studio command line environment with a specific version of the toolset (using VCVARS and company environment variables). So the recipe is compatible with "Visual Studio" compiler from the Conan universe. Still in this universe, using the new msvc compiler is allowed thanks to lines 47 and 53. But CCI still uses "Visual Studio". |
||
# to minimal MSVC version: | ||
# | ||
# | imaGL version | MSVC minimal version | | ||
# |---------------|----------------------------| | ||
# | 0.1.0 | 19.25 (default in VS 16.5) | | ||
# | 0.1.1 | 19.25 (default in VS 16.5) | | ||
# | 0.1.2 | 19.22 (default in VS 16.2) | | ||
# | 0.2.0 | 19.25 (default in VS 16.5) | | ||
# | 0.2.1 | 19.22 (default in VS 16.2) | | ||
# | ||
generator = "Ninja" if str(self.settings.compiler) == "Visual Studio" else None | ||
self._cmake = CMake(self, generator=generator) | ||
if not self.settings.compiler.cppstd: | ||
self._cmake.definitions['CONAN_CMAKE_CXX_STANDARD'] = "20" | ||
|
||
self._cmake.definitions["STATIC_LIB"] = not self.options.shared | ||
self._cmake.definitions["SUPPORT_PNG"] = self.options.with_png | ||
if self._supports_jpeg: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not assign a value here, it is not going to work... and future versions of Conan will fail here.