Skip to content

Commit

Permalink
modernize more
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Nov 10, 2022
1 parent 665aa42 commit 5e84da9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 4 additions & 6 deletions recipes/cityhash/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from conan.tools.scm import Version
import os

required_conan_version = ">=1.50.0"
required_conan_version = ">=1.53.0"


class CityhashConan(ConanFile):
Expand Down Expand Up @@ -44,10 +44,7 @@ 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 layout(self):
basic_layout(self, src_folder="src")
Expand All @@ -60,7 +57,7 @@ def build_requirements(self):
self.tool_requires("libtool/2.4.7")
if self._settings_build.os == "Windows":
self.win_bash = True
if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
if not self.conf.get("tools.microsoft.bash:path", check_type=str):
self.tool_requires("msys2/cci.latest")

def source(self):
Expand All @@ -77,6 +74,7 @@ def generate(self):
if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \
(self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"):
tc.extra_cflags.append("-FS")
tc.extra_cxxflags.append("-FS")
tc.generate()

if is_msvc(self):
Expand Down
8 changes: 3 additions & 5 deletions recipes/cityhash/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES CXX)
project(test_package)

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

find_package(cityhash REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE cityhash::cityhash)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)

0 comments on commit 5e84da9

Please sign in to comment.