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

Add spix/0.5 #15293

Merged
merged 14 commits into from
Feb 11, 2023
7 changes: 7 additions & 0 deletions recipes/spix/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ sources:
"0.4":
url: "https://github.com/faaxm/spix/archive/refs/tags/v0.4.tar.gz"
sha256: "e787c08840c37e5b153c0139f3bb613a2729ae8f6ccd0fb450fef92971cd8b53"
"0.5":
url: "https://github.com/faaxm/spix/archive/refs/tags/v0.5.tar.gz"
sha256: "d3fd9bb069aef6ff6c93c69524ed3603afd24e6b52e4bb8d093c80cec255d4dc"
patches:
"0.4":
- patch_file: "patches/0001-use-conan-libs-0.4.patch"
patch_description: "Link to conan libs"
patch_type: "conan"
"0.5":
- patch_file: "patches/0001-use-conan-libs-0.5.patch"
patch_description: "Link to conan libs"
patch_type: "conan"
27 changes: 17 additions & 10 deletions recipes/spix/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,24 @@ class SpixConan(ConanFile):

@property
def _minimum_cpp_standard(self):
return 14
return 14 if self.version == "0.4" else 17

@property
def _compilers_minimum_version(self):
return {
"Visual Studio": "14",
"gcc": "5",
"clang": "3.4",
"apple-clang": "10"
}
if self.version == "0.4":
return {
"Visual Studio": "14",
prince-chrismc marked this conversation as resolved.
Show resolved Hide resolved
"gcc": "5",
"clang": "3.4",
"apple-clang": "10"
}
else:
return {
"Visual Studio": "15.7",
prince-chrismc marked this conversation as resolved.
Show resolved Hide resolved
"gcc": "7",
"clang": "5",
"apple-clang": "10",
}

def export_sources(self):
export_conandata_patches(self)
Expand All @@ -59,8 +67,7 @@ def layout(self):

def requirements(self):
self.requires("anyrpc/1.0.2")
self.requires("qt/6.3.1")
self.requires("expat/2.4.9")
self.requires("qt/6.4.2")

def validate(self):
if self.info.settings.compiler.cppstd:
fdgStilla marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -91,7 +98,7 @@ def generate(self):

def _patch_sources(self):
apply_conandata_patches(self)
if Version(self.deps_cpp_info["qt"].version).major == 6:
if self.version == "0.4" and Version(self.deps_cpp_info["qt"].version).major == 6:
fdgStilla marked this conversation as resolved.
Show resolved Hide resolved
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_CXX_STANDARD 14)", "set(CMAKE_CXX_STANDARD 17)")

def build(self):
Expand Down
32 changes: 32 additions & 0 deletions recipes/spix/all/patches/0001-use-conan-libs-0.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,6 @@ option(SPIX_BUILD_EXAMPLES "Build Spix examples." ON)
option(SPIX_BUILD_TESTS "Build Spix unit tests." OFF)
set(SPIX_QT_MAJOR "6" CACHE STRING "Major Qt version to build Spix against")

-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
set(CMAKE_CXX_STANDARD 17)

# Hide symbols unless explicitly flagged with SPIX_EXPORT
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 723de5e..f234bec 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -8,7 +8,7 @@ include(CMakePackageConfigHelpers)
# Dependencies
#
find_package(Threads REQUIRED)
-find_package(AnyRPC REQUIRED)
+find_package(anyrpc REQUIRED)
fdgStilla marked this conversation as resolved.
Show resolved Hide resolved
find_package(Qt${SPIX_QT_MAJOR}
COMPONENTS
Core
@@ -132,7 +132,7 @@ target_link_libraries(Spix
Qt${SPIX_QT_MAJOR}::Gui
Qt${SPIX_QT_MAJOR}::Quick
PRIVATE
- AnyRPC::anyrpc
+ anyrpc::anyrpc
)

#
2 changes: 1 addition & 1 deletion recipes/spix/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ find_package(Spix REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_spix.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE Spix::Spix)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
5 changes: 0 additions & 5 deletions recipes/spix/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ def requirements(self):
def layout(self):
cmake_layout(self)

def _patch_sources(self):
fdgStilla marked this conversation as resolved.
Show resolved Hide resolved
if Version(self.deps_cpp_info["qt"].version).major == 6:
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "cxx_std_14", "cxx_std_17")

def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
5 changes: 0 additions & 5 deletions recipes/spix/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ class TestSpixV1Conan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def _patch_sources(self):
if Version(self.deps_cpp_info["qt"].version).major == 6:
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "cxx_std_14", "cxx_std_17")

def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
2 changes: 2 additions & 0 deletions recipes/spix/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"0.4":
folder: all
"0.5":
folder: all