-
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
soci: conan v2 support #17026
Merged
Merged
soci: conan v2 support #17026
Changes from 3 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
recipes/soci/all/patches/0001-Remove-hardcoded-INSTALL_NAME_DIR-for-relocatable-li.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From d491bf7b5040d314ffd0c6310ba01f78ff44c85e Mon Sep 17 00:00:00 2001 | ||
From: Rasmus Thomsen <[email protected]> | ||
Date: Fri, 14 Apr 2023 09:16:29 +0200 | ||
Subject: [PATCH] Remove hardcoded INSTALL_NAME_DIR for relocatable libraries | ||
on MacOS | ||
|
||
--- | ||
cmake/SociBackend.cmake | 2 +- | ||
src/core/CMakeLists.txt | 1 - | ||
2 files changed, 1 insertion(+), 2 deletions(-) | ||
|
||
diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake | ||
index 5d4ef0df..39fe1f77 100644 | ||
--- a/cmake/SociBackend.cmake | ||
+++ b/cmake/SociBackend.cmake | ||
@@ -171,7 +171,7 @@ macro(soci_backend NAME) | ||
set_target_properties(${THIS_BACKEND_TARGET} | ||
PROPERTIES | ||
SOVERSION ${${PROJECT_NAME}_SOVERSION} | ||
- INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib) | ||
+ ) | ||
|
||
if(APPLE) | ||
set_target_properties(${THIS_BACKEND_TARGET} | ||
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt | ||
index 3e7deeae..f9eae564 100644 | ||
--- a/src/core/CMakeLists.txt | ||
+++ b/src/core/CMakeLists.txt | ||
@@ -59,7 +59,6 @@ if (SOCI_SHARED) | ||
PROPERTIES | ||
VERSION ${SOCI_VERSION} | ||
SOVERSION ${SOCI_SOVERSION} | ||
- INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib | ||
CLEAN_DIRECT_OUTPUT 1) | ||
endif() | ||
|
||
-- | ||
2.25.1 | ||
|
17 changes: 0 additions & 17 deletions
17
recipes/soci/all/patches/0001-handle-libmysqlclient8.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
from conans import ConanFile, CMake, tools | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import CMake, cmake_layout | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
settings = "os", "arch", "compiler", "build_type", | ||
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") | ||
self.run(bin_path, env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(SOCI REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
if(TARGET SOCI::soci_core_static) | ||
target_link_libraries(${PROJECT_NAME} SOCI::soci_core_static) | ||
else() | ||
target_link_libraries(${PROJECT_NAME} SOCI::soci_core) | ||
endif() | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "soci/soci.h" | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
const auto& connectString{"../database0.empty.db"}; | ||
const auto& table{"table1"}; | ||
std::cout << "soci database connected successfully\n"; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
versions: | ||
"4.0.3": | ||
folder: all | ||
"4.0.2": | ||
folder: all | ||
"4.0.1": | ||
folder: all |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We can trim down this file to us the improved version https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt
and delete the duplicated source code in this folder as well 🙏
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.
Ah thanks for the pointer, done 👍