Skip to content

Commit

Permalink
Merge branch 'master' into llvm-openmp/new-version
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur authored Sep 19, 2023
2 parents 449280e + e1e14ff commit 2e5c8b8
Show file tree
Hide file tree
Showing 151 changed files with 1,379 additions and 665 deletions.
2 changes: 1 addition & 1 deletion docs/package_templates/header_only/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _min_cppstd(self):
def _compilers_minimum_version(self):
return {
"Visual Studio": "15",
"msvc": "14.1",
"msvc": "191",
"gcc": "5",
"clang": "5",
"apple-clang": "5.1",
Expand Down
4 changes: 4 additions & 0 deletions recipes/cgal/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ def _create_cmake_module_variables(self, module_file):
endfunction()
CGAL_setup_CGAL_flags(CGAL::CGAL)
# CGAL use may rely on the presence of those two variables
set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP")
set(CGAL_USE_MPFR TRUE CACHE INTERNAL "CGAL library is configured to use MPFR")
''')
save(self, module_file, content)

Expand Down
19 changes: 19 additions & 0 deletions recipes/cmake/binary/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
sources:
"3.27.5":
Linux:
armv8:
url: "https://cmake.org/files/v3.27/cmake-3.27.5-linux-aarch64.tar.gz"
sha256: "2ffaf176d0f93c332abaffbf3ce82fc8c90e49e0fcee8dc16338bcfbb150ead7"
x86_64:
url: "https://cmake.org/files/v3.27/cmake-3.27.5-linux-x86_64.tar.gz"
sha256: "138c68addae825b16ed78d792dafef5e0960194833f48bd77e7e0429c6bc081c"
Macos:
universal:
url: "https://cmake.org/files/v3.27/cmake-3.27.5-macos10.10-universal.tar.gz"
sha256: "1f776640e6ad35b2b3fe2ab5e39cff363b2c3034ecb56e45597402b7bf010e47"
Windows:
armv8:
url: "https://cmake.org/files/v3.27/cmake-3.27.5-windows-arm64.zip"
sha256: "3fcc84d34e3213b0e4261295eaddfc645685ab366dc570421555e7f3d3080d3a"
x86_64:
url: "https://cmake.org/files/v3.27/cmake-3.27.5-windows-x86_64.zip"
sha256: "1e8e06c8ecf63d5f213019e1cd39ea41a6cf952db5f2c8e69b8e47f5bc302684"
"3.27.4":
Linux:
armv8:
Expand Down
2 changes: 2 additions & 0 deletions recipes/cmake/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.27.5":
folder: "binary"
"3.27.4":
folder: "binary"
"3.27.1":
Expand Down
57 changes: 21 additions & 36 deletions recipes/cminpack/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools import files
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, rmdir
import os

required_conan_version = ">=1.45.0"
required_conan_version = ">=1.54.0"


class CMinpackConan(ConanFile):
Expand All @@ -14,7 +14,7 @@ class CMinpackConan(ConanFile):
topics = ("nonlinear", "solver")
homepage = "http://devernay.free.fr/hacks/cminpack/"
license = "LicenseRef-CopyrightMINPACK.txt"

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand All @@ -25,53 +25,39 @@ class CMinpackConan(ConanFile):
"fPIC": True,
}

def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_EXAMPLES"] = "OFF"
tc.variables["CMINPACK_LIB_INSTALL_DIR"] = "lib"
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()

def layout(self):
cmake_layout(self)

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

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

# cminpack is a c library
try:
del self.settings.compiler.libcxx
except Exception:
pass
try:
del self.settings.compiler.cppstd
except Exception:
pass
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")

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

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

def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_EXAMPLES"] = "OFF"
tc.variables["CMINPACK_LIB_INSTALL_DIR"] = "lib"
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
copy(self, "CopyrightMINPACK.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()

files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
files.copy(self, "CopyrightMINPACK.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
files.rmdir(self, os.path.join(self.package_folder, "share")) # contains cmake config files
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "share")) # contains cmake config files

def _library_postfix(self):
postfix = ""
Expand All @@ -92,7 +78,7 @@ def package_info(self):
self.cpp_info.components["cminpack-double"].names["cmake_find_package"] = "cminpack"
self.cpp_info.components["cminpack-double"].names["cmake_find_package_multi"] = "cminpack"
self.cpp_info.components["cminpack-double"].names["pkg_config"] = "cminpack"

# the single precision version
self.cpp_info.components['cminpack-single'].libs = ['cminpacks' + self._library_postfix()]
self.cpp_info.components['cminpack-single'].includedirs.append(minpack_include_dir)
Expand All @@ -102,7 +88,6 @@ def package_info(self):
self.cpp_info.components["cminpack-single"].names["cmake_find_package_multi"] = "cminpacks"
self.cpp_info.components["cminpack-single"].names["pkg_config"] = "cminpacks"


if self.settings.os != "Windows":
self.cpp_info.components['cminpack-double'].system_libs.append("m")
self.cpp_info.components['cminpack-single'].system_libs.append("m")
Expand Down
6 changes: 3 additions & 3 deletions recipes/cminpack/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12)
project(CMinPack-Conan-TestPackage C)
cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES C)

find_package(CMinpack REQUIRED)
find_package(CMinpack REQUIRED CONFIG)

# This builds one of the original cminpack examples against
# both types of the library
Expand Down
7 changes: 5 additions & 2 deletions recipes/cminpack/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@

from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
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 = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

def build(self):
cmake = CMake(self)
cmake.configure()
Expand Down
16 changes: 4 additions & 12 deletions recipes/cminpack/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
cmake_minimum_required(VERSION 3.1.2)
project(CMinPack-ConanV1-TestPackage C)
cmake_minimum_required(VERSION 3.1)
project(test_package)

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

find_package(CMinpack REQUIRED CONFIG)

# This builds one of the original cminpack examples against
# both types of the library

add_executable(cminpack_test_double ../test_package/tchkderc.c)
target_link_libraries(cminpack_test_double PRIVATE cminpack::cminpack)

add_executable(cminpack_test_float ../test_package/tchkderc.c)
target_link_libraries(cminpack_test_float PRIVATE cminpack::cminpacks)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)
5 changes: 4 additions & 1 deletion recipes/continuable/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
sources:
"4.2.2":
url: "https://github.com/Naios/continuable/archive/4.2.2.tar.gz"
sha256: "49bf82a349b26c01194631e4fe5d1dbad080b3b4a347eebc5cf95326ea130fba"
"4.2.1":
url: "https://github.com/Naios/continuable/archive/4.2.1.tar.gz"
sha256: "19c7c2371c94ec759eac8169dea593703b54057551322b5d682643548c9c0146"
"4.2.0":
url: "https://github.com/Naios/continuable/archive/4.2.0.tar.gz"
sha256: "d85bed930ac19d4b36b23778ad9ae943c2981f7492982bd51dadb89e8908d53f"
"4.1.0":
sha256: "CBCF50B1B73D8B4EB54734C827D6736CD038960E13F80699958DBB87F1827650"
url: "https://github.com/Naios/continuable/archive/4.1.0.tar.gz"
sha256: "CBCF50B1B73D8B4EB54734C827D6736CD038960E13F80699958DBB87F1827650"
2 changes: 1 addition & 1 deletion recipes/continuable/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("function2/4.1.0")
self.requires("function2/4.2.3")

def package_id(self):
self.info.clear()
Expand Down
2 changes: 1 addition & 1 deletion recipes/continuable/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(continuable REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(${PROJECT_NAME} PRIVATE continuable::continuable)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
2 changes: 2 additions & 0 deletions recipes/continuable/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"4.2.2":
folder: all
"4.2.1":
folder: all
"4.2.0":
Expand Down
3 changes: 3 additions & 0 deletions recipes/cpu_features/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.9.0":
url: "https://github.com/google/cpu_features/archive/refs/tags/v0.9.0.tar.gz"
sha256: "bdb3484de8297c49b59955c3b22dba834401bc2df984ef5cfc17acbe69c5018e"
"0.8.0":
url: "https://github.com/google/cpu_features/archive/refs/tags/v0.8.0.tar.gz"
sha256: "7021729f2db97aa34f218d12727314f23e8b11eaa2d5a907e8426bcb41d7eaac"
Expand Down
2 changes: 2 additions & 0 deletions recipes/cpu_features/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.9.0":
folder: "all"
"0.8.0":
folder: "all"
"0.7.0":
Expand Down
18 changes: 9 additions & 9 deletions recipes/crc_cpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
sources:
"1.0.0":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.0.tar.gz"
sha256: "035ed616e0662eddbe7db7c920faaef99bbeb8953ebf98c3bb76cb81a2c4de2b"
"1.0.1":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.1.tar.gz"
sha256: "865a0e110bf7e94061ceef1683947a7788b54f932c7ce3848edc89d36e1aea26"
"1.1.0":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.1.0.tar.gz"
sha256: "50e46e3c44eb39809f6697b253f7b36c089642d7b7f2ebe2f75adf23c50676be"
"1.2.0":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.2.0.tar.gz"
sha256: "508a609d9ef12c3088ed17a8ed820c965161a36dd90738c7358333fbfbe96af5"
"1.1.0":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.1.0.tar.gz"
sha256: "50e46e3c44eb39809f6697b253f7b36c089642d7b7f2ebe2f75adf23c50676be"
"1.0.1":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.1.tar.gz"
sha256: "865a0e110bf7e94061ceef1683947a7788b54f932c7ce3848edc89d36e1aea26"
"1.0.0":
url: "https://github.com/AshleyRoll/crc_cpp/archive/refs/tags/v1.0.0.tar.gz"
sha256: "035ed616e0662eddbe7db7c920faaef99bbeb8953ebf98c3bb76cb81a2c4de2b"
67 changes: 38 additions & 29 deletions recipes/crc_cpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from conan import ConanFile, tools
from conan.tools.scm import Version
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os

required_conan_version = ">=1.50.0"
Expand All @@ -9,45 +12,51 @@
class Crc_CppConan(ConanFile):
name = "crc_cpp"
description = "A header only constexpr / compile time small-table based CRC library for C++17 and newer"
topics = "crc_cpp", "crc", "constexpr", "cpp17", "cpp20", "header-only"
settings = "compiler", "os"
topics = ("crc", "constexpr", "cpp17", "cpp20", "header-only")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/AshleyRoll/crc_cpp"
license = "MIT"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

@property
def _source_subfolder(self):
return "source_subfolder"
def _min_cppstd(self):
return "17"

@property
def _supported_compiler(self):
compiler = str(self.settings.compiler)
version = Version(self.settings.compiler.version)
if compiler == "Visual Studio" and version >= "15":
return True
elif compiler == "gcc" and version >= "9":
return True
elif compiler == "clang" and version >= "5":
return True
elif compiler == "apple-clang" and version >= "10":
return True
else:
self.output.warn("{} recipe lacks information about the {} compiler standard version support".format(self.name, compiler))
return False
def _compilers_minimum_version(self):
return {
"gcc": "9",
"clang": "5",
"apple-clang": "10",
"Visual Studio": "15",
"msvc": "191",
}

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

def package_id(self):
self.info.clear()

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.build.check_min_cppstd(self, "17")
if not self._supported_compiler:
raise ConanInvalidConfiguration("crc_cpp: Unsupported compiler: {}-{} "
"Minimum C++17 constexpr features required.".format(self.settings.compiler, self.settings.compiler.version))
check_min_cppstd(self, self._min_cppstd)

minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)

def source(self):
tools.files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include"))
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include"))

def package_id(self):
self.info.header_only()
def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
9 changes: 3 additions & 6 deletions recipes/crc_cpp/all/test_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 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
find_package(crc_cpp REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
target_link_libraries(${PROJECT_NAME} PRIVATE crc_cpp::crc_cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
Loading

0 comments on commit 2e5c8b8

Please sign in to comment.