Skip to content

Commit

Permalink
qscintilla: drop Conan v1 support, clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Feb 10, 2025
1 parent d80e121 commit f98931b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
9 changes: 2 additions & 7 deletions recipes/qscintilla/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ cmake_minimum_required(VERSION 3.15)
project(QScintilla LANGUAGES CXX)

option(QSCINTILLA_BUILD_DESIGNER_PLUGIN "Build the QScintilla designer plugin" OFF)

if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
option(CMAKE_POSITION_INDEPENDENT_CODE "Generate position-independent code" ON)
option(CMAKE_CXX_STANDARD "C++ standard to use" 11)
set(CMAKE_AUTOMOC ON)

find_package(Qt6 REQUIRED)
Expand Down
22 changes: 7 additions & 15 deletions recipes/qscintilla/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import is_apple_os
from conan.tools.build import check_min_cppstd, can_run
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get

required_conan_version = ">=2.0.5"
required_conan_version = ">=2.0.9"


class QScintillaConan(ConanFile):
Expand All @@ -27,37 +27,30 @@ class QScintillaConan(ConanFile):
"shared": False,
"fPIC": True,
}
implements = ["auto_shared_fpic"]

def export_sources(self):
export_conandata_patches(self)
copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.options["qt"].widgets = True

def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("qt/[>=6.7.1 <7]", transitive_headers=True, transitive_libs=True, run=can_run(self))
self.requires("qt/[>=6.7.1 <7]", transitive_headers=True, transitive_libs=True)

def validate(self):
check_min_cppstd(self, 11)
if not self.dependencies["qt"].options.widgets:
raise ConanInvalidConfiguration("QScintilla requires -o qt/*:widgets=True")

def build_requirements(self):
if not can_run(self):
self.tool_requires("qt/<host_version>")
self.tool_requires("cmake/[>=3.27 <4]")
self.tool_requires("qt/<host_version>")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
apply_conandata_patches(self)

def generate(self):
tc = CMakeToolchain(self)
Expand All @@ -67,7 +60,6 @@ def generate(self):
deps.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
3 changes: 1 addition & 2 deletions recipes/qscintilla/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"
generators = "CMakeDeps", "CMakeToolchain"

def layout(self):
cmake_layout(self)
Expand Down

0 comments on commit f98931b

Please sign in to comment.