Skip to content

sqlitecpp: update dependencies, support mingw #14263

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

Merged
merged 1 commit into from
Nov 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions recipes/sqlitecpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import textwrap


required_conan_version = ">=1.51.1"
required_conan_version = ">=1.53"


class SQLiteCppConan(ConanFile):
Expand Down Expand Up @@ -40,13 +40,10 @@ def config_options(self):

def configure(self):
if self.options.shared:
try:
del self.options.fPIC
except Exception:
pass
self.options.rm_safe("fPIC")

def requirements(self):
self.requires("sqlite3/3.39.3")
self.requires("sqlite3/3.40.0")

def validate(self):
if Version(self.version) >= "3.0.0" and self.info.settings.compiler.get_safe("cppstd"):
Expand Down Expand Up @@ -120,13 +117,20 @@ def _create_cmake_module_alias_targets(self, module_file, targets):
def _module_file_rel_path(self):
return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake")

@property
def _is_mingw(self):
return self.settings.os == "Windows" and self.settings.compiler == "gcc"

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "SQLiteCpp")
self.cpp_info.set_property("cmake_target_name", "SQLiteCpp")
self.cpp_info.libs = ["SQLiteCpp"]
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs = ["pthread", "dl", "m"]

if self._is_mingw:
self.cpp_info.system_libs = ["ssp"]

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.names["cmake_find_package"] = "SQLiteCpp"
self.cpp_info.names["cmake_find_package_multi"] = "SQLiteCpp"
Expand Down
2 changes: 1 addition & 1 deletion recipes/sqlitecpp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(test_package CXX)
project(test_package LANGUAGES CXX)

find_package(SQLiteCpp REQUIRED CONFIG)

Expand Down
9 changes: 3 additions & 6 deletions recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 3.8)
project(test_package CXX)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(SQLiteCpp REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE SQLiteCpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
${CMAKE_CURRENT_BINARY_DIR}/test_package/)