Skip to content

Commit

Permalink
qwt: Added check for cppstd
Browse files Browse the repository at this point in the history
  • Loading branch information
ashley-b committed Nov 27, 2023
1 parent fd9d840 commit 0fcf732
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion recipes/qwt/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import cross_building
from conan.tools.build import cross_building, check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.env import VirtualBuildEnv, VirtualRunEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
Expand Down Expand Up @@ -48,6 +48,10 @@ class QwtConan(ConanFile):
def _is_legacy_one_profile(self):
return not hasattr(self, "settings_build")

@property
def _min_cppstd(self):
return 17 if self.dependencies["qt"].ref.version >= 6 else 11

def export_sources(self):
export_conandata_patches(self)

Expand All @@ -68,6 +72,8 @@ def requirements(self):
def validate(self):
if hasattr(self, "settings_build") and cross_building(self):
raise ConanInvalidConfiguration("Qwt recipe does not support cross-compilation yet")
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
qt_options = self.dependencies["qt"].options
if self.options.widgets and not qt_options.widgets:
raise ConanInvalidConfiguration("qwt:widgets=True requires qt:widgets=True")
Expand Down

0 comments on commit 0fcf732

Please sign in to comment.