commit ca60108606bb522a5c36cb14743de7ef3fddd80b Author: Romain BOULLARD Date: Fri Jan 23 22:15:36 2026 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33024ac --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +CMakeUserPresets.json \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9f074a7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,123 @@ +variables: + GIT_SUBMODULE_STRATEGY: recursive + +stages: + - packaging + +.Packaging: + variables: + PACKAGE: 'Unknown' + VERSION: 'Unknown' + LOCATION: 'all' + CCACHE_BASEDIR: $CI_PROJECT_DIR + image: registry.gitlab.com/bigfootdev/docker/linuxcppbuilder:main + stage: packaging + before_script: + - ccache --zero-stats + script: + - CONAN_LOGIN_USERNAME=${GITLAB_CONAN_USER} CONAN_PASSWORD=${GITLAB_CONAN_PASSWORD} conan create ./$PACKAGE/$LOCATION --version=$VERSION -pr:b=./clang -pr:h=./clang --build=missing --remote=bigfootpackages + - CONAN_LOGIN_USERNAME=${GITLAB_CONAN_USER} CONAN_PASSWORD=${GITLAB_CONAN_PASSWORD} conan upload $PACKAGE/$VERSION@ --only-recipe --remote=bigfootpackages + after_script: + - ccache --show-stats + dependencies: [] + tags: + - linux + - c++ + - bigfootdev + only: + variables: + - $CI_COMMIT_REF_PROTECTED + +PackageEABase: + extends: .Packaging + variables: + PACKAGE: 'eabase' + VERSION: '01082025' + +PackageEASTL: + extends: .Packaging + variables: + PACKAGE: 'eastl' + VERSION: '3.27.01' + needs: + - PackageEABase + +PackagePixelMatch: + extends: .Packaging + variables: + PACKAGE: 'pixelmatch-cpp17' + VERSION: '1.0.3' + +PackageLodePNG: + extends: .Packaging + variables: + PACKAGE: 'lodepng' + VERSION: 'cci.20250727' + +PackageStduuid: + extends: .Packaging + variables: + PACKAGE: 'stduuid' + VERSION: '1.2.3' + +PackageFlatbuffers: + extends: .Packaging + variables: + PACKAGE: 'flatbuffers' + VERSION: '25.12.19' + +PackageVulkanMemoryAllocator: + extends: .Packaging + variables: + PACKAGE: 'vulkan-memory-allocator' + VERSION: '3.3.0' + +PackageVulkanUtilityLibraries: + extends: .Packaging + variables: + PACKAGE: 'vulkan-utility-libraries' + VERSION: '1.4.313.0' + +PackageVulkanValidationLayers: + extends: .Packaging + variables: + PACKAGE: 'vulkan-validationlayers' + VERSION: '1.4.313.0' + needs: + - PackageVulkanUtilityLibraries + +PackageShaderC: + extends: .Packaging + variables: + PACKAGE: 'shaderc' + VERSION: '2025.3' + +PackageUnorderedDense: + extends: .Packaging + variables: + PACKAGE: 'unordered_dense' + VERSION: '4.8.1' + +PackageMimalloc: + extends: .Packaging + variables: + PACKAGE: 'mimalloc' + VERSION: '3.1.5' + +PackageMeshOptimizer: + extends: .Packaging + variables: + PACKAGE: 'meshoptimizer' + VERSION: '1.0' + +PackageSQLite3: + extends: .Packaging + variables: + PACKAGE: 'sqlite3' + VERSION: '3.51.0' + +PackageRapidHash: + extends: .Packaging + variables: + PACKAGE: 'rapidhash' + VERSION: '3.0' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8268d51 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022-2023 Romain BOULLARD + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/clang b/clang new file mode 100644 index 0000000..a4b4d51 --- /dev/null +++ b/clang @@ -0,0 +1,24 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=18 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +compiler.cstd=17 +build_type=Release +[conf] +tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'} +tools.cmake.cmaketoolchain:generator=Ninja +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=True +tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} + +tools.build:exelinkflags=["-fuse-ld=mold", "-flto"] +tools.build:sharedlinkflags=["-fuse-ld=mold", "-flto"] + +tools.build:cflags=["-flto"] +tools.build:cxxflags=["-flto"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] diff --git a/eabase/all/conandata.yml b/eabase/all/conandata.yml new file mode 100644 index 0000000..39e7eec --- /dev/null +++ b/eabase/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "01082025": + url: "https://github.com/electronicarts/EABase/archive/0699a15efdfd20b6cecf02153bfa5663decb653c.zip" + sha256: "bf3bcf296cd1960d95b145f404d2b325e65b47b750e654ca19d05f1e4fc763a5" + "18082024": + url: "https://github.com/electronicarts/EABase/archive/123363eb82e132c0181ac53e43226d8ee76dea12.zip" + sha256: "74ee83236e40122cafff06a9456f1a28b24b6fd94cf72cc8615b7a9470895adc" + "2.09.12": + url: "https://github.com/electronicarts/EABase/archive/d1be0a1d0fc01a9bf8f3f2cea75018df0d2410ee.zip" + sha256: "53b72d188aa17c7b23aa6bef9a4767854e82eac46a027dec233d12fd3dfbc677" + "2.09.06": + url: "https://github.com/electronicarts/EABase/archive/refs/heads/2.09.06.zip" + sha256: "3223c2b81dcdccaeb9fca7a83695f9edb402b817c89c073c0eb3ee64646699ea" + "2.09.05": + url: "https://github.com/electronicarts/EABase/archive/2.09.05.tar.gz" + sha256: "f85b98c96f1976aa013c8d6016c5e37a409633ac3fce843cd4ec0b89c67e6b7a" +patches: + "01082025": + - patch_file: "patches/bump_cmake.patch" + patch_description: "Bump cmake version" + patch_type: "conan" \ No newline at end of file diff --git a/eabase/all/conanfile.py b/eabase/all/conanfile.py new file mode 100644 index 0000000..a75dd7f --- /dev/null +++ b/eabase/all/conanfile.py @@ -0,0 +1,68 @@ +import os + +from conan import ConanFile +from conan.tools.files import ( + apply_conandata_patches, + export_conandata_patches, + copy, + get, +) +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class EABaseConan(ConanFile): + name = "eabase" + description = "EABase is a small set of header files that define platform-independent data types and platform feature macros. " + topics = ("eastl", "config") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/electronicarts/EABase" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs += [ + os.path.join("include", "Common"), + os.path.join("include", "Common", "EABase"), + ] + + self.cpp_info.set_property("cmake_file_name", "EABase") + self.cpp_info.set_property("cmake_target_name", "EABase::EABase") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "EABase" + self.cpp_info.filenames["cmake_find_package_multi"] = "EABase" + self.cpp_info.names["cmake_find_package"] = "EABase" + self.cpp_info.names["cmake_find_package_multi"] = "EABase" diff --git a/eabase/all/patches/bump_cmake.patch b/eabase/all/patches/bump_cmake.patch new file mode 100644 index 0000000..fbd5f60 --- /dev/null +++ b/eabase/all/patches/bump_cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 652f07f..11e4430 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + #------------------------------------------------------------------------------------------- + # Copyright (C) Electronic Arts Inc. All rights reserved. + #------------------------------------------------------------------------------------------- +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.5) + project(EABase CXX) + + #------------------------------------------------------------------------------------------- diff --git a/eabase/all/test_package/CMakeLists.txt b/eabase/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..d2f6d0c --- /dev/null +++ b/eabase/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(EABase REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE EABase::EABase) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/eabase/all/test_package/conanfile.py b/eabase/all/test_package/conanfile.py new file mode 100644 index 0000000..0a808db --- /dev/null +++ b/eabase/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/eabase/all/test_package/test_package.cpp b/eabase/all/test_package/test_package.cpp new file mode 100644 index 0000000..1c57fbc --- /dev/null +++ b/eabase/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#include + +#include +#include + +#ifndef EA_COMPILER_IS_ANSIC +#define EA_COMPILER_IS_ANSIC 0 +#endif +#ifndef EA_COMPILER_IS_C99 +#define EA_COMPILER_IS_C99 0 +#endif +#ifndef EA_COMPILER_IS_C99 +#define EA_COMPILER_IS_C99 0 +#endif +#ifndef EA_COMPILER_HAS_C99_TYPES +#define EA_COMPILER_HAS_C99_TYPES 0 +#endif +#ifndef EA_COMPILER_IS_CPLUSPLUS +#define EA_COMPILER_IS_CPLUSPLUS 0 +#endif + +int main() { +#define PRINT_COMPILER_INFO(VAR) std::cout << #VAR << ": " << (VAR) << '\n' + + PRINT_COMPILER_INFO(EA_COMPILER_VERSION); + PRINT_COMPILER_INFO(EA_COMPILER_NAME); + PRINT_COMPILER_INFO(EA_COMPILER_STRING); + + std::cout << '\n'; + + PRINT_COMPILER_INFO(EA_PLATFORM_NAME); + PRINT_COMPILER_INFO(EA_PLATFORM_DESCRIPTION); + + std::cout << '\n'; + + PRINT_COMPILER_INFO(EA_COMPILER_IS_ANSIC); + PRINT_COMPILER_INFO(EA_COMPILER_IS_C99); + PRINT_COMPILER_INFO(EA_COMPILER_HAS_C99_TYPES); + PRINT_COMPILER_INFO(EA_COMPILER_IS_CPLUSPLUS); + + std::cout << '\n'; + + PRINT_COMPILER_INFO(EA_PLATFORM_PTR_SIZE); + PRINT_COMPILER_INFO(EA_PLATFORM_WORD_SIZE); + + return EXIT_SUCCESS; +} diff --git a/eabase/all/test_v1_package/CMakeLists.txt b/eabase/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..f6d6c96 --- /dev/null +++ b/eabase/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_v1_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/eabase/all/test_v1_package/conanfile.py b/eabase/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..c492184 --- /dev/null +++ b/eabase/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/eabase/config.yml b/eabase/config.yml new file mode 100644 index 0000000..28d7bcf --- /dev/null +++ b/eabase/config.yml @@ -0,0 +1,11 @@ +versions: + "01082025": + folder: "all" + "18082024": + folder: "all" + "2.09.12": + folder: "all" + "2.09.06": + folder: "all" + "2.09.05": + folder: "all" diff --git a/eastl/all/conandata.yml b/eastl/all/conandata.yml new file mode 100644 index 0000000..59863fe --- /dev/null +++ b/eastl/all/conandata.yml @@ -0,0 +1,101 @@ +sources: + "3.27.01": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.27.01.tar.gz" + sha256: "fce43bf443f5569b00a8deae735394ea0b16f6c3f96867a17ded50775ffcdd12" + "3.27.00": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.27.00.tar.gz" + sha256: "5606643e41ab12fd7c209755fe04dca581ed01f43dec515288b1544eea22623f" + "3.21.23": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.21.23.tar.gz" + sha256: "2bcb48f88f7daf9f91c165aae751c10d11d6959b6e10f2dda8f1db893e684022" + "3.21.12": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.21.12.tar.gz" + sha256: "2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e" + "3.18.00": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.18.00.tar.gz" + sha256: "a3c5b970684be02e81fb16fbf92ed2584e055898704fde87c72d0331afdea12b" + "3.17.06": + url: "https://github.com/electronicarts/EASTL/archive/3.17.06.tar.gz" + sha256: "9ebeef26cdf091877ee348450d2711cd0bb60ae435309126c0adf8fec9a01ea5" + "3.17.03": + url: "https://github.com/electronicarts/EASTL/archive/3.17.03.tar.gz" + sha256: "50a072066e30fda364d482df6733572d8ca440a33825d81254b59a6ca9f4375a" + "3.16.07": + url: "https://github.com/electronicarts/EASTL/archive/3.16.07.tar.gz" + sha256: "f997a81c8cb36618bd4526ea7a02d026c8111d15fbc138c67ba8f4606680d551" + "3.16.05": + url: "https://github.com/electronicarts/EASTL/archive/3.16.05.tar.gz" + sha256: "deebff248ec0d4da35ca006cec39abdcfe65ccbd7294f6fbdb42fc92232368b6" + "3.16.01": + url: "https://github.com/electronicarts/EASTL/archive/3.16.01.tar.gz" + sha256: "80b0754ea02364dfd3f94e3b65c93087849a8d407196702c0cae59097fbe8d21" + "3.15.00": + url: "https://github.com/electronicarts/EASTL/archive/3.15.00.tar.gz" + sha256: "1578a2935ca490920b96c960fb570dab025280bb978fba40c88eb9ac74760c14" +patches: + "3.27.01": + - patch_file: "patches/3.27.01-0001-use-conan.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.27.01-0002-fix-assert-unused.patch" + patch_description: "disable warning for unused parameter inside assert file" + patch_type: "conan" + "3.27.00": + - patch_file: "patches/3.27.00-0001-use-conan.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.27.00-0002-fix-assert-unused.patch" + patch_description: "disable warning for unused parameter inside assert file" + patch_type: "conan" + "3.21.23": + - patch_file: "patches/3.21.23-0001-use-conan.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + "3.21.12": + - patch_file: "patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" + - patch_file: "patches/3.21.12-0003-rename_reference.patch" + patch_description: "use eastl::remove_reference instead of std::remove_reference" + patch_type: "portability" + patch_source: "https://github.com/electronicarts/EASTL/issues/512" + "3.18.00": + - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" + "3.17.06": + - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" + "3.17.03": + - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" + "3.16.07": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + "3.16.05": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + "3.16.01": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + "3.15.00": + - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" diff --git a/eastl/all/conanfile.py b/eastl/all/conanfile.py new file mode 100644 index 0000000..4be20e1 --- /dev/null +++ b/eastl/all/conanfile.py @@ -0,0 +1,152 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + replace_in_file, + rmdir, +) +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class EastlConan(ConanFile): + name = "eastl" + description = ( + "EASTL stands for Electronic Arts Standard Template Library. " + "It is an extensive and robust implementation that has an " + "emphasis on high performance." + ) + topics = ("eastl", "stl", "high-performance") + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/electronicarts/EASTL" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + if Version(self.version) < "3.27.00": + return 14 + else: + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "14", + "msvc": "190", + "gcc": "5" if Version(self.version) < "3.21.12" else "6", + "clang": "3.2", + "apple-clang": "4.3", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.version >= "3.27.00": + self.requires("eabase/01082025", transitive_headers=True) + elif self.version == "3.21.23": + self.requires("eabase/18082024", transitive_headers=True) + else: + self.requires("eabase/2.09.12", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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." + ) + + if is_msvc(self) and check_min_vs(self, "193", raise_invalid=False) and Version(self.version) < "3.21.12": + raise ConanInvalidConfiguration(f"{self.ref} is not compatible with Visual Studio 2022, please use version >= 3.21.12") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EASTL_BUILD_BENCHMARK"] = False + tc.variables["EASTL_BUILD_TESTS"] = False + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + CMakeDeps(self).generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "include(CommonCppFlags)", + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + copy( + self, + "3RDPARTYLICENSES.TXT", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) + + def package_info(self): + self.cpp_info.libs = ["EASTL"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + if self.options.shared: + self.cpp_info.defines.append("EA_DLL") + + self.cpp_info.set_property("cmake_file_name", "EASTL") + self.cpp_info.set_property("cmake_target_name", "EASTL::EASTL") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "EASTL" + self.cpp_info.filenames["cmake_find_package_multi"] = "EASTL" + self.cpp_info.names["cmake_find_package"] = "EASTL" + self.cpp_info.names["cmake_find_package_multi"] = "EASTL" diff --git a/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch b/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000..cb7647d --- /dev/null +++ b/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,23 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,5 +46,19 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-target_link_libraries(EASTL EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) + ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() ++ ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) diff --git a/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch b/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000..8e8ec2e --- /dev/null +++ b/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,27 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -47,8 +47,22 @@ + # Dependencies + #------------------------------------------------------------------------------------------- + if (NOT TARGET EABase) +- add_subdirectory(test/packages/EABase) ++ #add_subdirectory(test/packages/EABase) + endif() + +-target_link_libraries(EASTL EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) + ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() ++ ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) diff --git a/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch b/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch new file mode 100644 index 0000000..9167720 --- /dev/null +++ b/eastl/all/patches/3.17.03-0002-revert-c++14-constexpr.patch @@ -0,0 +1,18 @@ +--- include/EASTL/internal/config.h ++++ include/EASTL/internal/config.h +@@ -143,7 +143,14 @@ + // http://en.wikipedia.org/wiki/C%2B%2B14#Relaxed_constexpr_restrictions + // + #if !defined(EA_CPP14_CONSTEXPR) +- #if defined(EA_COMPILER_CPP14_ENABLED) ++ ++ #if defined(EA_COMPILER_MSVC_2015) ++ #define EA_CPP14_CONSTEXPR // not supported ++ #define EA_NO_CPP14_CONSTEXPR ++ #elif defined(__GNUC__) && (EA_COMPILER_VERSION < 9000) // Before GCC 9.0 ++ #define EA_CPP14_CONSTEXPR // not supported ++ #define EA_NO_CPP14_CONSTEXPR ++ #elif defined(EA_COMPILER_CPP14_ENABLED) + #define EA_CPP14_CONSTEXPR constexpr + #else + #define EA_CPP14_CONSTEXPR // not supported diff --git a/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch b/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000..475e121 --- /dev/null +++ b/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3eb444..f033794 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,11 +59,22 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-if (NOT TARGET EABase) +- add_subdirectory(test/packages/EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() + endif() + +-target_link_libraries(EASTL EABase) ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) + + #------------------------------------------------------------------------------------------- + # Installation diff --git a/eastl/all/patches/3.21.12-0003-rename_reference.patch b/eastl/all/patches/3.21.12-0003-rename_reference.patch new file mode 100644 index 0000000..686977d --- /dev/null +++ b/eastl/all/patches/3.21.12-0003-rename_reference.patch @@ -0,0 +1,13 @@ +diff --git a/include/EASTL/internal/type_transformations.h b/include/EASTL/internal/type_transformations.h +index 5454cfa..54a1c14 100644 +--- a/include/EASTL/internal/type_transformations.h ++++ b/include/EASTL/internal/type_transformations.h +@@ -497,7 +497,7 @@ namespace eastl + namespace internal + { + template +- auto try_add_pointer(int) -> type_identity::type*>; ++ auto try_add_pointer(int) -> type_identity::type*>; + template + auto try_add_pointer(...) -> type_identity; + } diff --git a/eastl/all/patches/3.21.23-0001-use-conan.patch b/eastl/all/patches/3.21.23-0001-use-conan.patch new file mode 100644 index 0000000..fc8dad9 --- /dev/null +++ b/eastl/all/patches/3.21.23-0001-use-conan.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,16 +70,15 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-FetchContent_Declare( +- EABase +- GIT_REPOSITORY https://github.com/electronicarts/EABase.git +- GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12 +- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase. +-) +- +-FetchContent_MakeAvailable(EABase) +- +-target_link_libraries(EASTL EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() + + #------------------------------------------------------------------------------------------- + # Deprecations +@@ -98,6 +97,13 @@ endif() + #------------------------------------------------------------------------------------------- + # Installation + #------------------------------------------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) ++ + install(TARGETS EASTL DESTINATION lib) + install(DIRECTORY include/EASTL DESTINATION include) + \ No newline at end of file diff --git a/eastl/all/patches/3.27.00-0001-use-conan.patch b/eastl/all/patches/3.27.00-0001-use-conan.patch new file mode 100644 index 0000000..b39f08e --- /dev/null +++ b/eastl/all/patches/3.27.00-0001-use-conan.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0124dc7..c048fb8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,16 +70,15 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-FetchContent_Declare( +- EABase +- GIT_REPOSITORY https://github.com/electronicarts/EABase.git +- GIT_TAG 0699a15efdfd20b6cecf02153bfa5663decb653c +- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase. +-) +- +-FetchContent_MakeAvailable(EABase) +- +-target_link_libraries(EASTL EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() + + #------------------------------------------------------------------------------------------- + # Deprecations +@@ -98,6 +97,13 @@ endif() + #------------------------------------------------------------------------------------------- + # Installation + #------------------------------------------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) ++ + install(TARGETS EASTL DESTINATION lib) + install(DIRECTORY include/EASTL DESTINATION include) + diff --git a/eastl/all/patches/3.27.00-0002-fix-assert-unused.patch b/eastl/all/patches/3.27.00-0002-fix-assert-unused.patch new file mode 100644 index 0000000..4595799 --- /dev/null +++ b/eastl/all/patches/3.27.00-0002-fix-assert-unused.patch @@ -0,0 +1,13 @@ +diff --git a/source/assert.cpp b/source/assert.cpp +index d08878f..41426ae 100644 +--- a/source/assert.cpp ++++ b/source/assert.cpp +@@ -52,7 +52,7 @@ namespace eastl + /// this function is not called in a thread-unsafe way. The easiest way to do this is + /// to just call this function once from the main thread on application startup. + /// +- EASTL_API void SetAssertionFailureFunction(EASTL_AssertionFailureFunction pAssertionFailureFunction, void* pContext) ++ EASTL_API void SetAssertionFailureFunction(EASTL_AssertionFailureFunction pAssertionFailureFunction, [[maybe_unused]] void* pContext) + { + static EASTL_AssertionFailureFunction assertionFailureFunction_; + assertionFailureFunction_ = pAssertionFailureFunction; diff --git a/eastl/all/patches/3.27.01-0001-use-conan.patch b/eastl/all/patches/3.27.01-0001-use-conan.patch new file mode 100644 index 0000000..b39f08e --- /dev/null +++ b/eastl/all/patches/3.27.01-0001-use-conan.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0124dc7..c048fb8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,16 +70,15 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-FetchContent_Declare( +- EABase +- GIT_REPOSITORY https://github.com/electronicarts/EABase.git +- GIT_TAG 0699a15efdfd20b6cecf02153bfa5663decb653c +- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase. +-) +- +-FetchContent_MakeAvailable(EABase) +- +-target_link_libraries(EASTL EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() ++endif() + + #------------------------------------------------------------------------------------------- + # Deprecations +@@ -98,6 +97,13 @@ endif() + #------------------------------------------------------------------------------------------- + # Installation + #------------------------------------------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) ++ + install(TARGETS EASTL DESTINATION lib) + install(DIRECTORY include/EASTL DESTINATION include) + diff --git a/eastl/all/patches/3.27.01-0002-fix-assert-unused.patch b/eastl/all/patches/3.27.01-0002-fix-assert-unused.patch new file mode 100644 index 0000000..4595799 --- /dev/null +++ b/eastl/all/patches/3.27.01-0002-fix-assert-unused.patch @@ -0,0 +1,13 @@ +diff --git a/source/assert.cpp b/source/assert.cpp +index d08878f..41426ae 100644 +--- a/source/assert.cpp ++++ b/source/assert.cpp +@@ -52,7 +52,7 @@ namespace eastl + /// this function is not called in a thread-unsafe way. The easiest way to do this is + /// to just call this function once from the main thread on application startup. + /// +- EASTL_API void SetAssertionFailureFunction(EASTL_AssertionFailureFunction pAssertionFailureFunction, void* pContext) ++ EASTL_API void SetAssertionFailureFunction(EASTL_AssertionFailureFunction pAssertionFailureFunction, [[maybe_unused]] void* pContext) + { + static EASTL_AssertionFailureFunction assertionFailureFunction_; + assertionFailureFunction_ = pAssertionFailureFunction; diff --git a/eastl/all/test_package/CMakeLists.txt b/eastl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..8223214 --- /dev/null +++ b/eastl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(EASTL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} EASTL::EASTL) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/eastl/all/test_package/conanfile.py b/eastl/all/test_package/conanfile.py new file mode 100644 index 0000000..ef5d704 --- /dev/null +++ b/eastl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + 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 can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/eastl/all/test_package/test_package.cpp b/eastl/all/test_package/test_package.cpp new file mode 100644 index 0000000..28e03c5 --- /dev/null +++ b/eastl/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +// https://github.com/electronicarts/EASTL/blob/master/doc/FAQ.md#info15-how-hard-is-it-to-incorporate-eastl-into-my-project +void *operator new[](size_t size, [[maybe_unused]] const char *pName, [[maybe_unused]] int flags, [[maybe_unused]] unsigned debugFlags, [[maybe_unused]] const char *file, [[maybe_unused]] int line) { + return new uint8_t[size]; +} +void *operator new[](size_t size, [[maybe_unused]] size_t alignment, [[maybe_unused]] size_t alignmentOffset, [[maybe_unused]] const char *pName, [[maybe_unused]] int flags, [[maybe_unused]] unsigned debugFlags, [[maybe_unused]] const char *file, [[maybe_unused]] int line) { + return new uint8_t[size]; +} + +int main() { + eastl::hash_map map; + map[0] = 1; + return 0; +} diff --git a/eastl/config.yml b/eastl/config.yml new file mode 100644 index 0000000..5ac17e9 --- /dev/null +++ b/eastl/config.yml @@ -0,0 +1,23 @@ +versions: + "3.27.01": + folder: "all" + "3.27.00": + folder: "all" + "3.21.23": + folder: "all" + "3.21.12": + folder: "all" + "3.18.00": + folder: "all" + "3.17.06": + folder: "all" + "3.17.03": + folder: "all" + "3.16.07": + folder: "all" + "3.16.05": + folder: "all" + "3.16.01": + folder: "all" + "3.15.00": + folder: "all" diff --git a/flatbuffers/all/cmake/FlatcTargets.cmake b/flatbuffers/all/cmake/FlatcTargets.cmake new file mode 100644 index 0000000..cddc331 --- /dev/null +++ b/flatbuffers/all/cmake/FlatcTargets.cmake @@ -0,0 +1,31 @@ +if(NOT TARGET flatbuffers::flatc) + if(CMAKE_CROSSCOMPILING) + find_program(FLATBUFFERS_FLATC_EXECUTABLE + NAMES flatc + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(FLATBUFFERS_FLATC_EXECUTABLE + NAMES flatc + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH + ) + endif() + # TODO: In conan v2 with CMakeToolchain, can be replaced by: + # find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) + # # Nice enough to handle flatbuffers not in build_requires for native build + # if(NOT FLATBUFFERS_FLATC_EXECUTABLE AND NOT CMAKE_CROSSCOMPILING) + # find_program(FLATBUFFERS_FLATC_EXECUTABLE + # NAMES flatc + # PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + # NO_DEFAULT_PATH + # ) + # endif() + + if(FLATBUFFERS_FLATC_EXECUTABLE) + get_filename_component(FLATBUFFERS_FLATC_EXECUTABLE "${FLATBUFFERS_FLATC_EXECUTABLE}" ABSOLUTE) + add_executable(flatbuffers::flatc IMPORTED) + set_property(TARGET flatbuffers::flatc PROPERTY IMPORTED_LOCATION ${FLATBUFFERS_FLATC_EXECUTABLE}) + endif() +endif() diff --git a/flatbuffers/all/conandata.yml b/flatbuffers/all/conandata.yml new file mode 100644 index 0000000..8840876 --- /dev/null +++ b/flatbuffers/all/conandata.yml @@ -0,0 +1,62 @@ +sources: + "25.12.19": + url: "https://github.com/google/flatbuffers/archive/v25.12.19.tar.gz" + sha256: "f81c3162b1046fe8b84b9a0dbdd383e24fdbcf88583b9cb6028f90d04d90696a" + "25.9.23": + url: "https://github.com/google/flatbuffers/archive/v25.9.23.tar.gz" + sha256: "9102253214dea6ae10c2ac966ea1ed2155d22202390b532d1dea64935c518ada" + "25.2.10": + url: "https://github.com/google/flatbuffers/archive/v25.2.10.tar.gz" + sha256: "b9c2df49707c57a48fc0923d52b8c73beb72d675f9d44b2211e4569be40a7421" + "24.12.23": + url: "https://github.com/google/flatbuffers/archive/v24.12.23.tar.gz" + sha256: "7e2ef35f1af9e2aa0c6a7d0a09298c2cb86caf3d4f58c0658b306256e5bcab10" + "24.3.25": + url: "https://github.com/google/flatbuffers/archive/v24.3.25.tar.gz" + sha256: "4157c5cacdb59737c5d627e47ac26b140e9ee28b1102f812b36068aab728c1ed" + "24.3.7": + url: "https://github.com/google/flatbuffers/archive/v24.3.7.tar.gz" + sha256: "bfff9d2150fcff88f844e8c608b02b2a0e94c92aea39b04c0624783464304784" + "23.5.26": + url: "https://github.com/google/flatbuffers/archive/v23.5.26.tar.gz" + sha256: "1cce06b17cddd896b6d73cc047e36a254fb8df4d7ea18a46acf16c4c0cd3f3f3" + "23.3.3": + url: "https://github.com/google/flatbuffers/archive/v23.3.3.tar.gz" + sha256: "8aff985da30aaab37edf8e5b02fda33ed4cbdd962699a8e2af98fdef306f4e4d" + "23.1.21": + url: "https://github.com/google/flatbuffers/archive/v23.1.21.tar.gz" + sha256: "d84cb25686514348e615163b458ae0767001b24b42325f426fd56406fd384238" + "22.12.06": + url: "https://github.com/google/flatbuffers/archive/v22.12.06.tar.gz" + sha256: "209823306f2cbedab6ff70997e0d236fcfd1864ca9ad082cbfdb196e7386daed" + "22.11.23": + url: "https://github.com/google/flatbuffers/archive/v22.11.23.tar.gz" + sha256: "8e9bacc942db59ca89a383dd7923f3e69a377d6e579d1ba13557de1fdfddf56a" + "22.10.26": + url: "https://github.com/google/flatbuffers/archive/v22.10.26.tar.gz" + sha256: "34f1820cfd78a3d92abc880fbb1a644c7fb31a71238995f4ed6b5915a1ad4e79" + "22.9.29": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v22.9.29.tar.gz" + sha256: "372df01795c670f6538055a7932fc7eb3e81b3653be4a216c081e9c3c26b1b6d" + "2.0.8": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.8.tar.gz" + sha256: "f97965a727d26386afaefff950badef2db3ab6af9afe23ed6d94bfb65f95f37e" + "2.0.5": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.5.tar.gz" + sha256: "b01e97c988c429e164c5c7df9e87c80007ca87f593c0d73733ba536ddcbc8f98" + "1.12.0": + url: "https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz" + sha256: "62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45" +patches: + "2.0.5": + - patch_file: "patches/0002-apple-no-universal-build.patch" + patch_description: "Don't use universal2 architecture" + patch_type: "bugfix" + - patch_file: "patches/0003-no-flatc-execution-build-time.patch" + patch_description: "No flatc execution during build time" + patch_type: "conan" + "1.12.0": + - patch_file: "patches/0005-arm-cxx-compiler-build.patch" + patch_description: "IAR ARM C++ Compiler build bugfix" + patch_type: "backport" + patch_source: "https://github.com/google/flatbuffers/commit/82fac326c5981a85233b8ae7e0d7ec8fda432963" diff --git a/flatbuffers/all/conanfile.py b/flatbuffers/all/conanfile.py new file mode 100644 index 0000000..4f6cbc9 --- /dev/null +++ b/flatbuffers/all/conanfile.py @@ -0,0 +1,158 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, collect_libs, copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.1" + + +class FlatbuffersConan(ConanFile): + name = "flatbuffers" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://google.github.io/flatbuffers" + topics = ("serialization", "rpc", "json-parser") + description = "Memory Efficient Serialization Library" + + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + } + + def _has_flatc(self, info=False): + # don't build flatc when it makes little sense or not supported + host_os = self.info.settings.os if info else self.settings.os + return host_os not in ["Android", "iOS", "watchOS", "tvOS", "Neutrino"] + + def export_sources(self): + copy(self, os.path.join("cmake", "FlatcTargets.cmake"), self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only and not self._has_flatc(info=True): + self.info.clear() + + def validate(self): + check_min_cppstd(self, 11) + + def build_requirements(self): + # since 23.3.3 version, flatbuffers cmake scripts were refactored to use cmake 3.8 version + # see https://github.com/google/flatbuffers/pull/7801 + if Version(self.version) >= "2.0.8" and Version(self.version) < "23.3.3": + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FLATBUFFERS_BUILD_TESTS"] = False + tc.variables["FLATBUFFERS_INSTALL"] = True + tc.variables["FLATBUFFERS_BUILD_FLATLIB"] = not self.options.header_only and not self.options.shared + tc.variables["FLATBUFFERS_BUILD_FLATC"] = self._has_flatc() + tc.variables["FLATBUFFERS_STATIC_FLATC"] = False + tc.variables["FLATBUFFERS_BUILD_FLATHASH"] = False + tc.variables["FLATBUFFERS_BUILD_SHAREDLIB"] = not self.options.header_only and self.options.shared + # Honor conan profile + tc.variables["FLATBUFFERS_LIBCXX_WITH_CLANG"] = False + # Mimic upstream CMake/Version.cmake removed in _patch_sources() + version = Version(self.version) + tc.cache_variables["VERSION_MAJOR"] = str(version.major) + tc.cache_variables["VERSION_MINOR"] = str(version.minor or "0") + tc.cache_variables["VERSION_PATCH"] = str(version.patch or "0") + tc.cache_variables["VERSION_COMMIT"] = str(version.pre or "0") + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Fix iOS/tvOS/watchOS + if is_apple_os(self): + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Prefer manual injection of current version in build(), otherwise it tries to call git + replace_in_file(self, cmakelists, "include(CMake/Version.cmake)", "") + # No warnings as errors + replace_in_file(self, cmakelists, "/WX", "") + replace_in_file(self, cmakelists, "-Werror ", "") + # Install dll to bin folder + replace_in_file(self, cmakelists, + "RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}", + "RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "FlatcTargets.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + copy(self, "BuildFlatBuffers.cmake", + src=os.path.join(self.source_folder, "CMake"), + dst=os.path.join(self.package_folder, self._module_path)) + + @property + def _module_path(self): + return os.path.join("lib", "cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "flatbuffers") + self.cpp_info.set_property("cmake_file_name", "flatbuffers") + cmake_target = "flatbuffers" + if not self.options.header_only and self.options.shared: + cmake_target += "_shared" + self.cpp_info.set_property("cmake_target_name", f"flatbuffers::{cmake_target}") + self.cpp_info.set_property("pkg_config_name", "flatbuffers") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if not self.options.header_only: + self.cpp_info.components["libflatbuffers"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libflatbuffers"].system_libs.append("m") + + # Provide flatbuffers::flatc target and CMake functions from BuildFlatBuffers.cmake + build_modules = [ + os.path.join(self._module_path, "FlatcTargets.cmake"), + os.path.join(self._module_path, "BuildFlatBuffers.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) + + if self._has_flatc(): + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/flatbuffers/all/patches/0002-apple-no-universal-build.patch b/flatbuffers/all/patches/0002-apple-no-universal-build.patch new file mode 100644 index 0000000..43e3e8f --- /dev/null +++ b/flatbuffers/all/patches/0002-apple-no-universal-build.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -282,7 +282,6 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) + + elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + if(APPLE) +- set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") diff --git a/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch b/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch new file mode 100644 index 0000000..8716b3b --- /dev/null +++ b/flatbuffers/all/patches/0003-no-flatc-execution-build-time.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -514,6 +514,7 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT) + register_generated_output(${GEN_BFBS_HEADER}) + endfunction() + ++if(0) + # Look if we have python 3 installed so that we can run the generate code python + # script after flatc is built. + find_package(PythonInterp 3) +@@ -544,6 +545,7 @@ if(PYTHONINTERP_FOUND AND + else() + message("No Python3 interpreter found! Unable to generate files automatically.") + endif() ++endif() + + if(FLATBUFFERS_BUILD_TESTS) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch b/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch new file mode 100644 index 0000000..11da02e --- /dev/null +++ b/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 21e90151..2ce3eb48 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -536,6 +536,7 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT) + register_generated_output(${GEN_BFBS_HEADER}) + endfunction() + ++if(0) + # Look if we have python 3.5 installed so that we can run the generate code + # python script after flatc is built. + find_package(Python3 3.5 COMPONENTS Interpreter) +@@ -559,6 +560,7 @@ if(Python3_Interpreter_FOUND) + else() + message("No Python3 interpreter found! Unable to generate files automatically.") + endif() ++endif() + + if(FLATBUFFERS_BUILD_TESTS) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/flatbuffers/all/patches/0005-arm-cxx-compiler-build.patch b/flatbuffers/all/patches/0005-arm-cxx-compiler-build.patch new file mode 100644 index 0000000..7ea4300 --- /dev/null +++ b/flatbuffers/all/patches/0005-arm-cxx-compiler-build.patch @@ -0,0 +1,16 @@ +diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h +index c4dc5bcd..0f3a7dfd 100644 +--- a/include/flatbuffers/flatbuffers.h ++++ b/include/flatbuffers/flatbuffers.h +@@ -1871,10 +1871,7 @@ class FlatBufferBuilder { + vector_downward &buf_; + + private: +- TableKeyComparator &operator=(const TableKeyComparator &other) { +- buf_ = other.buf_; +- return *this; +- } ++ FLATBUFFERS_DELETE_FUNC(TableKeyComparator &operator=(const TableKeyComparator &other)) + }; + /// @endcond + diff --git a/flatbuffers/all/test_package/CMakeLists.txt b/flatbuffers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..4bb176d --- /dev/null +++ b/flatbuffers/all/test_package/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(FlatBuffers REQUIRED CONFIG) +if(TARGET flatbuffers::flatbuffers_shared) + set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) +else() + set(FLATBUFFERS_TARGET flatbuffers::flatbuffers) +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLATBUFFERS_TARGET}) +if(FLATBUFFERS_HEADER_ONLY) + target_compile_definitions(${PROJECT_NAME} PRIVATE FLATBUFFERS_HEADER_ONLY) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +# Testing this block in case of cross-build would require to add flatbuffers to build requirements of test package +# But due to c3i limitations, package id of build requirement if header_only is not available while building in c3i +if(NOT CMAKE_CROSSCOMPILING) + add_executable(sample_binary sample_binary.cpp) + target_link_libraries(sample_binary PRIVATE ${FLATBUFFERS_TARGET}) + target_compile_features(sample_binary PRIVATE cxx_std_11) + + set(MONSTER_GENERATED_HEADER ${CMAKE_CURRENT_BINARY_DIR}/monster_generated.h) + set(MONSTER_FBS ${CMAKE_CURRENT_SOURCE_DIR}/monster.fbs) + add_custom_command( + OUTPUT ${MONSTER_GENERATED_HEADER} + COMMAND $ + --cpp + -o ${CMAKE_CURRENT_BINARY_DIR} + ${MONSTER_FBS} + DEPENDS ${MONSTER_FBS} + ) + add_custom_target(generate_monster_header DEPENDS ${MONSTER_GENERATED_HEADER}) + add_dependencies(sample_binary generate_monster_header) + target_include_directories(sample_binary PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +endif() diff --git a/flatbuffers/all/test_package/conanfile.py b/flatbuffers/all/test_package/conanfile.py new file mode 100644 index 0000000..c045cfa --- /dev/null +++ b/flatbuffers/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def generate(self): + env = VirtualRunEnv(self) + env.generate() + if can_run(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) + tc.variables["FLATBUFFERS_HEADER_ONLY"] = self.dependencies["flatbuffers"].options.header_only + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + sample_binary = os.path.join(self.cpp.build.bindirs[0], "sample_binary") + self.run(sample_binary, env="conanrun") diff --git a/flatbuffers/all/test_package/monster.fbs b/flatbuffers/all/test_package/monster.fbs new file mode 100644 index 0000000..af22451 --- /dev/null +++ b/flatbuffers/all/test_package/monster.fbs @@ -0,0 +1,33 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; + color:Color = Blue; + weapons:[Weapon]; + equipped:Equipment; + path:[Vec3]; +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; diff --git a/flatbuffers/all/test_package/sample_binary.cpp b/flatbuffers/all/test_package/sample_binary.cpp new file mode 100644 index 0000000..b8f4f1f --- /dev/null +++ b/flatbuffers/all/test_package/sample_binary.cpp @@ -0,0 +1,104 @@ +/* + * Copyright 2015 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h". + +using namespace MyGame::Sample; + +// Example how to use FlatBuffers to create and read binary buffers. + +int main(int /*argc*/, const char * /*argv*/[]) { + // Build up a serialized buffer algorithmically: + flatbuffers::FlatBufferBuilder builder; + + // First, lets serialize some weapons for the Monster: A 'sword' and an 'axe'. + auto weapon_one_name = builder.CreateString("Sword"); + short weapon_one_damage = 3; + + auto weapon_two_name = builder.CreateString("Axe"); + short weapon_two_damage = 5; + + // Use the `CreateWeapon` shortcut to create Weapons with all fields set. + auto sword = CreateWeapon(builder, weapon_one_name, weapon_one_damage); + auto axe = CreateWeapon(builder, weapon_two_name, weapon_two_damage); + + // Create a FlatBuffer's `vector` from the `std::vector`. + std::vector> weapons_vector; + weapons_vector.push_back(sword); + weapons_vector.push_back(axe); + auto weapons = builder.CreateVector(weapons_vector); + + // Second, serialize the rest of the objects needed by the Monster. + auto position = Vec3(1.0f, 2.0f, 3.0f); + + auto name = builder.CreateString("MyMonster"); + + unsigned char inv_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + auto inventory = builder.CreateVector(inv_data, 10); + + // Shortcut for creating monster with all fields set: + auto orc = CreateMonster(builder, &position, 150, 80, name, inventory, + Color_Red, weapons, Equipment_Weapon, axe.Union()); + + builder.Finish(orc); // Serialize the root of the object. + + // We now have a FlatBuffer we can store on disk or send over a network. + + // ** file/network code goes here :) ** + // access builder.GetBufferPointer() for builder.GetSize() bytes + + // Instead, we're going to access it right away (as if we just received it). + + // Get access to the root: + auto monster = GetMonster(builder.GetBufferPointer()); + + // Get and test some scalar types from the FlatBuffer. + assert(monster->hp() == 80); + assert(monster->mana() == 150); // default + assert(monster->name()->str() == "MyMonster"); + + // Get and test a field of the FlatBuffer's `struct`. + auto pos = monster->pos(); + assert(pos); + assert(pos->z() == 3.0f); + (void)pos; + + // Get a test an element from the `inventory` FlatBuffer's `vector`. + auto inv = monster->inventory(); + assert(inv); + assert(inv->Get(9) == 9); + (void)inv; + + // Get and test the `weapons` FlatBuffers's `vector`. + std::string expected_weapon_names[] = { "Sword", "Axe" }; + short expected_weapon_damages[] = { 3, 5 }; + auto weps = monster->weapons(); + for (unsigned int i = 0; i < weps->size(); i++) { + assert(weps->Get(i)->name()->str() == expected_weapon_names[i]); + assert(weps->Get(i)->damage() == expected_weapon_damages[i]); + } + (void)expected_weapon_names; + (void)expected_weapon_damages; + + // Get and test the `Equipment` union (`equipped` field). + assert(monster->equipped_type() == Equipment_Weapon); + auto equipped = static_cast(monster->equipped()); + assert(equipped->name()->str() == "Axe"); + assert(equipped->damage() == 5); + (void)equipped; + + printf("The FlatBuffer was successfully created and verified!\n"); +} diff --git a/flatbuffers/all/test_package/test_package.cpp b/flatbuffers/all/test_package/test_package.cpp new file mode 100644 index 0000000..b5846ed --- /dev/null +++ b/flatbuffers/all/test_package/test_package.cpp @@ -0,0 +1,48 @@ +/* + * Copyright 2018 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "flatbuffers/flatbuffers.h" + +#ifndef FLATBUFFERS_HEADER_ONLY + #include "flatbuffers/util.h" +#endif +// Test to validate Conan package generated + +int main(int /*argc*/, const char * /*argv*/ []) { + + flatbuffers::FlatBufferBuilder builder; + const auto offset = builder.CreateString("test"); + if (!offset.IsNull()) { + std::cout << "Offset is " << builder.CreateString("test").o << ".\n"; + } else { + std::cout << "Offset is null.\n"; + return EXIT_FAILURE; + } + +#ifndef FLATBUFFERS_HEADER_ONLY + const std::string filename("conanbuildinfo.txt"); + if (flatbuffers::FileExists(filename.c_str())) { + std::cout << "File " << filename << " exists.\n"; + } else { + std::cout << "File " << filename << " does not exist.\n"; + } +#endif + + return EXIT_SUCCESS; +} diff --git a/flatbuffers/config.yml b/flatbuffers/config.yml new file mode 100644 index 0000000..8e0e3a3 --- /dev/null +++ b/flatbuffers/config.yml @@ -0,0 +1,33 @@ +versions: + "25.12.19": + folder: all + "25.9.23": + folder: all + "25.2.10": + folder: all + "24.12.23": + folder: all + "24.3.25": + folder: all + "24.3.7": + folder: all + "23.5.26": + folder: all + "23.3.3": + folder: all + "23.1.21": + folder: all + "22.12.06": + folder: all + "22.11.23": + folder: all + "22.10.26": + folder: all + "22.9.29": + folder: all + "2.0.8": + folder: all + "2.0.5": + folder: all + "1.12.0": + folder: all diff --git a/lodepng/all/CMakeLists.txt b/lodepng/all/CMakeLists.txt new file mode 100644 index 0000000..048f8cf --- /dev/null +++ b/lodepng/all/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(lodepng LANGUAGES CXX) + +add_library(lodepng ${LODEPNG_SRC_DIR}/lodepng.cpp) +set_target_properties(lodepng PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(GNUInstallDirs) +install(TARGETS lodepng + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") +install(FILES ${LODEPNG_SRC_DIR}/lodepng.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/lodepng/all/conandata.yml b/lodepng/all/conandata.yml new file mode 100644 index 0000000..e543916 --- /dev/null +++ b/lodepng/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20250727": + url: "https://github.com/lvandeve/lodepng/archive/344b4b442d0de0787a999724dd6569461a00c92c.tar.gz" + sha256: "ffc13ecfbe27978e018e2ac6b089d6a2bd1a571d81b5ebb50e7364ec17ca3a74" + "cci.20241228": + url: "https://github.com/lvandeve/lodepng/archive/0b1d9ccfc2093e5d6620cd9a11d03ee6ff6705f5.tar.gz" + sha256: "d3efafbd2c938f834aa9ff764e93425fdf7f78e9f74e92285ff991b45708c72a" diff --git a/lodepng/all/conanfile.py b/lodepng/all/conanfile.py new file mode 100644 index 0000000..cf5e725 --- /dev/null +++ b/lodepng/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class LodepngConan(ConanFile): + name = "lodepng" + description = "PNG encoder and decoder in C and C++, without dependencies." + license = "Zlib" + topics = ("png", "encoder", "decoder") + homepage = "https://github.com/lvandeve/lodepng" + url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("lodepng shared doesn't support Visual Studio with static runtime") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LODEPNG_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["lodepng"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/lodepng/all/test_package/CMakeLists.txt b/lodepng/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..fa65d49 --- /dev/null +++ b/lodepng/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(lodepng REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lodepng::lodepng) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/lodepng/all/test_package/conanfile.py b/lodepng/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/lodepng/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "CMakeToolchain", "CMakeDeps", "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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/lodepng/all/test_package/test_package.cpp b/lodepng/all/test_package/test_package.cpp new file mode 100644 index 0000000..9f83682 --- /dev/null +++ b/lodepng/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "lodepng.h" + +int main(int argc, const char *argv[]) +{ + LodePNGCompressSettings compress_settings; + lodepng_compress_settings_init(&compress_settings); + + printf("compress_settings.btype = %d\n", compress_settings.btype); + + return 0; +} diff --git a/lodepng/all/test_v1_package/CMakeLists.txt b/lodepng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/lodepng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/lodepng/all/test_v1_package/conanfile.py b/lodepng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/lodepng/all/test_v1_package/conanfile.py @@ -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) diff --git a/lodepng/config.yml b/lodepng/config.yml new file mode 100644 index 0000000..d790ca6 --- /dev/null +++ b/lodepng/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20250727": + folder: all + "cci.20241228": + folder: all diff --git a/meshoptimizer/all/conandata.yml b/meshoptimizer/all/conandata.yml new file mode 100644 index 0000000..260c26c --- /dev/null +++ b/meshoptimizer/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v1.0.tar.gz" + sha256: "30d1c3651986b2074e847b17223a7269c9612ab7f148b944250f81214fed4993" + "0.25": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.25.tar.gz" + sha256: "68b2fef4e4eaad98e00c657c1e7f8982a7176e61dd7efdeaec67a025b8519be9" diff --git a/meshoptimizer/all/conanfile.py b/meshoptimizer/all/conanfile.py new file mode 100644 index 0000000..0e6a9f3 --- /dev/null +++ b/meshoptimizer/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +import os + +required_conan_version = ">=1.54.0" + + +class MeshOptimizerConan(ConanFile): + name = "meshoptimizer" + description = "Mesh optimization library that makes meshes smaller and faster to render" + topics = ("mesh", "optimizer", "3d") + homepage = "https://github.com/zeux/meshoptimizer" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MESHOPT_BUILD_SHARED_LIBS"] = self.options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "meshoptimizer") + self.cpp_info.set_property("cmake_target_name", "meshoptimizer::meshoptimizer") + self.cpp_info.libs = ["meshoptimizer"] + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + if self.options.shared: + self.cpp_info.defines = ["MESHOPTIMIZER_ALLOC_EXPORT"] + if self.settings.os == "Windows": + self.cpp_info.defines.append("MESHOPTIMIZER_API=__declspec(dllimport)") diff --git a/meshoptimizer/all/test_package/CMakeLists.txt b/meshoptimizer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..ca75338 --- /dev/null +++ b/meshoptimizer/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(meshoptimizer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE meshoptimizer::meshoptimizer) diff --git a/meshoptimizer/all/test_package/conanfile.py b/meshoptimizer/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/meshoptimizer/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "CMakeToolchain", "CMakeDeps", "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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/meshoptimizer/all/test_package/test_package.c b/meshoptimizer/all/test_package/test_package.c new file mode 100644 index 0000000..854c054 --- /dev/null +++ b/meshoptimizer/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "meshoptimizer.h" + +int main() +{ + meshopt_encodeVertexVersion(0); + meshopt_encodeIndexVersion(1); + + return 0; +} diff --git a/meshoptimizer/config.yml b/meshoptimizer/config.yml new file mode 100644 index 0000000..13f9acc --- /dev/null +++ b/meshoptimizer/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0": + folder: all + "0.25": + folder: all diff --git a/mimalloc/all/cmake/MinjectTargets.cmake b/mimalloc/all/cmake/MinjectTargets.cmake new file mode 100644 index 0000000..384fef9 --- /dev/null +++ b/mimalloc/all/cmake/MinjectTargets.cmake @@ -0,0 +1,37 @@ +if(NOT TARGET minject) + if(CMAKE_CROSSCOMPILING) + find_program(MINJECT_EXECUTABLE + NAMES minject + PATHS ENV PATH + NO_DEFAULT_PATH + ) + find_program(MINJECT32_EXECUTABLE + NAMES minject32 + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(MINJECT_EXECUTABLE + NAMES minject + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH + ) + find_program(MINJECT32_EXECUTABLE + NAMES minject32 + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH + ) + endif() + + if(MINJECT_EXECUTABLE) + get_filename_component(MINJECT_EXECUTABLE "${MINJECT_EXECUTABLE}" ABSOLUTE) + add_executable(minject IMPORTED) + set_property(TARGET minject PROPERTY IMPORTED_LOCATION ${MINJECT_EXECUTABLE}) + endif() + + if(MINJECT32_EXECUTABLE) + get_filename_component(MINJECT32_EXECUTABLE "${MINJECT32_EXECUTABLE}" ABSOLUTE) + add_executable(minject32 IMPORTED) + set_property(TARGET minject32 PROPERTY IMPORTED_LOCATION ${MINJECT32_EXECUTABLE}) + endif() +endif() diff --git a/mimalloc/all/conandata.yml b/mimalloc/all/conandata.yml new file mode 100644 index 0000000..39d5f15 --- /dev/null +++ b/mimalloc/all/conandata.yml @@ -0,0 +1,80 @@ +sources: + "3.1.5": + url: "https://github.com/microsoft/mimalloc/archive/v3.1.5.tar.gz" + sha256: "1c6949032069d5ebea438ec5cedd602d06f40a92ddf0f0d9dcff0993e5f6635c" + "2.2.4": + url: "https://github.com/microsoft/mimalloc/archive/v2.2.4.tar.gz" + sha256: "754a98de5e2912fddbeaf24830f982b4540992f1bab4a0a8796ee118e0752bda" + "2.1.9": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.9.tar.gz" + sha256: "dd8ff701691f19bf4e225d42ef0d3d5e6ca0e03498ee4f044a0402e4697e4a20" + "2.1.7": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.7.tar.gz" + sha256: "0eed39319f139afde8515010ff59baf24de9e47ea316a315398e8027d198202d" + "2.1.2": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.2.tar.gz" + sha256: "2b1bff6f717f9725c70bf8d79e4786da13de8a270059e4ba0bdd262ae7be46eb" + "2.0.9": + url: "https://github.com/microsoft/mimalloc/archive/v2.0.9.tar.gz" + sha256: "4a29edae32a914a706715e2ac8e7e4109e25353212edeed0888f4e3e15db5850" + "1.8.7": + url: "https://github.com/microsoft/mimalloc/archive/v1.8.7.tar.gz" + sha256: "347793a2c614e525edc4e286ab5cbc4c7a5efc12503e2dafca276d78394c4f07" + "1.8.2": + url: "https://github.com/microsoft/mimalloc/archive/v1.8.2.tar.gz" + sha256: "4058d53d6ceb75862f32c30a6ee686c3cbb5e965b2c324b828ca454f7fe064f9" + "1.7.9": + url: "https://github.com/microsoft/mimalloc/archive/v1.7.9.tar.gz" + sha256: "45e05be518363d32b2cdcce1a1fac3580895ea2e4524e1a3c7e71145cb58659f" + "1.7.6": + url: "https://github.com/microsoft/mimalloc/archive/v1.7.6.tar.gz" + sha256: "d74f86ada2329016068bc5a243268f1f555edd620b6a7d6ce89295e7d6cf18da" +patches: + "2.2.4": + - patch_file: "patches/2.2.4-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "2.1.9": + - patch_file: "patches/2.1.9-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "2.1.7": + - patch_file: "patches/2.1.7-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "2.1.2": + - patch_file: "patches/2.1.2-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - patch_file: "patches/2.1.2-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "2.0.9": + - patch_file: "patches/2.0.9-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - patch_file: "patches/2.0.9-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "1.8.7": + - patch_file: "patches/1.8.7-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "1.8.2": + - patch_file: "patches/1.8.2-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - patch_file: "patches/1.8.2-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "1.7.9": + - patch_file: "patches/1.7.9-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" + - patch_file: "patches/1.7.9-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "1.7.6": + - patch_file: "patches/1.7.5-0001-change-install-paths.patch" + patch_description: "fix install paths" + patch_type: "conan" diff --git a/mimalloc/all/conanfile.py b/mimalloc/all/conanfile.py new file mode 100644 index 0000000..1f12ff6 --- /dev/null +++ b/mimalloc/all/conanfile.py @@ -0,0 +1,246 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file, collect_libs +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, VCVars +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version +import os +import shutil + +required_conan_version = ">=2" + + +class MimallocConan(ConanFile): + name = "mimalloc" + description = "mimalloc is a compact general purpose allocator with excellent performance." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/mimalloc" + topics = ("mimalloc", "allocator", "performance", "microsoft") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "secure": [True, False], + "override": [True, False], + "inject": [True, False], + "single_object": [True, False], + "guarded": [True, False], + "win_redirect": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "secure": False, + "override": False, + "inject": False, + "single_object": False, + "guarded": False, + "win_redirect": False, + } + + def export_sources(self): + export_conandata_patches(self) + copy(self, os.path.join("cmake", "MinjectTargets.cmake"), self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.win_redirect + + # single_object and inject are options + # only when overriding on Unix-like platforms: + if is_msvc(self): + del self.options.single_object + del self.options.inject + if Version(self.version) < "2.1.9": + del self.options.guarded + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + # single_object is valid only for static + # override: + self.options.rm_safe("single_object") + + # inject is valid only for Unix-like dynamic override: + if not self.options.shared: + self.options.rm_safe("inject") + + # single_object and inject are valid only when + # overriding on Unix-like platforms: + if not self.options.override: + self.options.rm_safe("single_object") + self.options.rm_safe("inject") + + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + # Currently, mimalloc some version do not work properly with shared MD builds. + # https://github.com/conan-io/conan-center-index/pull/10333#issuecomment-1114110046 + if Version(self.version) == "1.7.6" and \ + self.options.shared and \ + is_msvc(self) and \ + not is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + f"Currently, {self.ref} doesn't work properly with shared MD builds in CCI. Contributions welcomed") + + # Shared overriding requires dynamic runtime for MSVC: + if self.options.override and \ + self.options.shared and \ + is_msvc(self) and \ + is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Dynamic runtime (MD/MDd) is required when using mimalloc as a shared library for override") + + if self.options.get_safe("win_redirect") and not ( + self.options.override and \ + self.options.shared and \ + is_msvc(self) and \ + not is_msvc_static_runtime(self)): + raise ConanInvalidConfiguration( + "Windows redirect requires 'override', 'shared' and building against a dynamic runtime (MD/MDd)") + + if self.options.override and \ + self.options.get_safe("single_object") and \ + self.options.get_safe("inject"): + raise ConanInvalidConfiguration("Single object is incompatible with library injection") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.18 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MI_BUILD_TESTS"] = "OFF" + tc.variables["MI_BUILD_SHARED"] = self.options.shared + tc.variables["MI_BUILD_STATIC"] = not self.options.shared + tc.variables["MI_BUILD_OBJECT"] = self.options.get_safe("single_object", False) + tc.variables["MI_OVERRIDE"] = "ON" if self.options.override else "OFF" + tc.variables["MI_SECURE"] = "ON" if self.options.secure else "OFF" + tc.variables["MI_WIN_REDIRECT"] = "ON" if self.options.get_safe("win_redirect") else "OFF" + tc.variables["MI_INSTALL_TOPLEVEL"] = "ON" + tc.variables["MI_GUARDED"] = self.options.get_safe("guarded", False) + if Version(self.version) <= "1.7.6": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + tc.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self) and self.settings.arch == "x86" and self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "mimalloc-redirect.lib", + "mimalloc-redirect32.lib") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + if self.options.get_safe("single_object"): + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + shutil.copy(os.path.join(self.package_folder, "lib", self._obj_name + ".o"), + os.path.join(self.package_folder, "lib", self._obj_name)) + + if self.settings.os == "Windows" and self.options.shared: + if self.settings.arch == "x86_64": + copy(self, "mimalloc-redirect.dll", + src=os.path.join(self.source_folder, "bin"), + dst=os.path.join(self.package_folder, "bin")) + copy(self, "minject.exe", + src=os.path.join(self.source_folder, "bin"), + dst=os.path.join(self.package_folder, "bin")) + elif self.settings.arch == "x86": + copy(self, "mimalloc-redirect32.dll", + src=os.path.join(self.source_folder, "bin"), + dst=os.path.join(self.package_folder, "bin")) + copy(self, "minject32.exe", + src=os.path.join(self.source_folder, "bin"), + dst=os.path.join(self.package_folder, "bin")) + + rmdir(self, os.path.join(self.package_folder, "share")) + + copy(self, "MinjectTargets.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + + @property + def _obj_name(self): + name = "mimalloc" + if self.options.secure: + name += "-secure" + if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): + name += "-{}".format(str(self.settings.build_type).lower()) + return name + + @property + def _lib_name(self): + name = "mimalloc" if self.settings.os == "Windows" else "libmimalloc" + + if self.settings.os == "Windows" and not self.options.shared: + name += "-static" + if self.options.secure: + name += "-secure" + if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): + name += "-{}".format(str(self.settings.build_type).lower()) + return name + + @property + def _module_path(self): + return os.path.join(self.package_folder, "lib", "cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mimalloc") + self.cpp_info.set_property("cmake_target_name", "mimalloc" if self.options.shared else "mimalloc-static") + + if self.options.get_safe("inject"): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + return + + if self.options.get_safe("single_object"): + obj_ext = "o" + obj_file = "{}.{}".format(self._obj_name, obj_ext) + obj_path = os.path.join(self.package_folder, "lib", obj_file) + self.cpp_info.exelinkflags = [obj_path] + self.cpp_info.sharedlinkflags = [obj_path] + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + else: + self.cpp_info.libs = collect_libs(self) + + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["psapi", "shell32", "user32", "bcrypt"]) + elif self.settings.os == "Linux": + self.cpp_info.system_libs.append("rt") + + if self.settings.os == "Windows" and self.options.shared: + build_modules = [ + os.path.join(self._module_path, "MinjectTargets.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) diff --git a/mimalloc/all/patches/1.7.5-0001-change-install-paths.patch b/mimalloc/all/patches/1.7.5-0001-change-install-paths.patch new file mode 100644 index 0000000..e4bbfaf --- /dev/null +++ b/mimalloc/all/patches/1.7.5-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d1207bb..feeecb6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -319,7 +319,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + +@@ -343,7 +343,7 @@ if (MI_BUILD_STATIC) + set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) + endif() + +- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) ++ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/mimalloc/all/patches/1.7.9-0001-change-install-paths.patch b/mimalloc/all/patches/1.7.9-0001-change-install-paths.patch new file mode 100644 index 0000000..1091c50 --- /dev/null +++ b/mimalloc/all/patches/1.7.9-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0011b87..41a15a2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -383,7 +383,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + +@@ -407,7 +407,7 @@ if (MI_BUILD_STATIC) + set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) + endif() + +- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) ++ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/mimalloc/all/patches/1.7.9-0002-support-older-compiler.patch b/mimalloc/all/patches/1.7.9-0002-support-older-compiler.patch new file mode 100644 index 0000000..7a9f7ed --- /dev/null +++ b/mimalloc/all/patches/1.7.9-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index f590033..a4275c5 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -493,7 +493,7 @@ template struct _mi_heap_stl_allocator_common : public _m + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -504,7 +504,7 @@ protected: + this->heap.reset(hp, (destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/1.8.2-0001-change-install-paths.patch b/mimalloc/all/patches/1.8.2-0001-change-install-paths.patch new file mode 100644 index 0000000..fb5aaa8 --- /dev/null +++ b/mimalloc/all/patches/1.8.2-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2bcd1ef..615cec9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -415,7 +415,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + +@@ -439,7 +439,7 @@ if (MI_BUILD_STATIC) + set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) + endif() + +- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) ++ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/mimalloc/all/patches/1.8.2-0002-support-older-compiler.patch b/mimalloc/all/patches/1.8.2-0002-support-older-compiler.patch new file mode 100644 index 0000000..139ede7 --- /dev/null +++ b/mimalloc/all/patches/1.8.2-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index 368c22c..fb19939 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -505,7 +505,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -516,7 +516,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch b/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch new file mode 100644 index 0000000..4b1890b --- /dev/null +++ b/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index ae6f99b..773424e 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -511,7 +511,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -522,7 +522,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/2.0.9-0001-change-install-paths.patch b/mimalloc/all/patches/2.0.9-0001-change-install-paths.patch new file mode 100644 index 0000000..91c4b6f --- /dev/null +++ b/mimalloc/all/patches/2.0.9-0001-change-install-paths.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74c1f29..d657144 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -383,7 +383,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + +@@ -407,7 +407,7 @@ if (MI_BUILD_STATIC) + set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) + endif() + +- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) ++ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/mimalloc/all/patches/2.0.9-0002-support-older-compiler.patch b/mimalloc/all/patches/2.0.9-0002-support-older-compiler.patch new file mode 100644 index 0000000..d8c3917 --- /dev/null +++ b/mimalloc/all/patches/2.0.9-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index 9b72fbf..b34362f 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -500,7 +500,7 @@ template struct _mi_heap_stl_allocator_common : public _m + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -511,7 +511,7 @@ protected: + this->heap.reset(hp, (destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/2.1.2-0001-change-install-paths.patch b/mimalloc/all/patches/2.1.2-0001-change-install-paths.patch new file mode 100644 index 0000000..eb6660f --- /dev/null +++ b/mimalloc/all/patches/2.1.2-0001-change-install-paths.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2bcd1ef..37eee49 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -415,7 +415,7 @@ if(MI_BUILD_SHARED) + install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) + endif() + +- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) ++ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) + endif() + diff --git a/mimalloc/all/patches/2.1.2-0002-support-older-compiler.patch b/mimalloc/all/patches/2.1.2-0002-support-older-compiler.patch new file mode 100644 index 0000000..58a4298 --- /dev/null +++ b/mimalloc/all/patches/2.1.2-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index f77c2ea..4c9594f 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -508,7 +508,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -519,7 +519,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch b/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch new file mode 100644 index 0000000..34149f1 --- /dev/null +++ b/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index c41bcc8..cc4929e 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -512,7 +512,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -523,7 +523,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/2.1.9-0002-support-older-compiler.patch b/mimalloc/all/patches/2.1.9-0002-support-older-compiler.patch new file mode 100644 index 0000000..4dfb677 --- /dev/null +++ b/mimalloc/all/patches/2.1.9-0002-support-older-compiler.patch @@ -0,0 +1,23 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index bd91db4..f6aa1aa 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -544,7 +544,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -555,7 +555,8 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) ++ { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/patches/2.2.4-0002-support-older-compiler.patch b/mimalloc/all/patches/2.2.4-0002-support-older-compiler.patch new file mode 100644 index 0000000..5a1792c --- /dev/null +++ b/mimalloc/all/patches/2.2.4-0002-support-older-compiler.patch @@ -0,0 +1,23 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index bd91db4..f6aa1aa 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -555,7 +555,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -566,7 +566,8 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) ++ { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/mimalloc/all/test_package/CMakeLists.txt b/mimalloc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..9c81dcf --- /dev/null +++ b/mimalloc/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(mimalloc REQUIRED CONFIG) + +find_program(MINJECT_EXECUTABLE NAMES minject) +execute_process(COMMAND ${MINJECT_EXECUTABLE} -h) + +find_program(MINJECT32_EXECUTABLE NAMES minject32) +execute_process(COMMAND ${MINJECT32_EXECUTABLE} -h) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE $,mimalloc,mimalloc-static>) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/mimalloc/all/test_package/conanfile.py b/mimalloc/all/test_package/conanfile.py new file mode 100644 index 0000000..3a32051 --- /dev/null +++ b/mimalloc/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +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 = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def configure(self): + self.options["mimalloc"].shared = True + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/mimalloc/all/test_package/test_package.c b/mimalloc/all/test_package/test_package.c new file mode 100644 index 0000000..bb4e51f --- /dev/null +++ b/mimalloc/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include "mimalloc.h" + +#include +#include + +int main() { + void *data = mi_malloc(32); + + printf("mimalloc version %d\n", mi_version()); + + mi_free(data); + + return EXIT_SUCCESS; +} diff --git a/mimalloc/config.yml b/mimalloc/config.yml new file mode 100644 index 0000000..e271b34 --- /dev/null +++ b/mimalloc/config.yml @@ -0,0 +1,23 @@ +versions: + "3.1.5": + folder: all + "2.2.4": + folder: all + "2.1.9": + folder: all + "2.1.7": + folder: all + # mold requires 2.1.2 + "2.1.2": + folder: all + "2.0.9": + folder: all + "1.8.7": + folder: all + "1.8.2": + folder: all + "1.7.9": + folder: all + # arrow requires 1.7.6 + "1.7.6": + folder: all diff --git a/pixelmatch-cpp17/all/conandata.yml b/pixelmatch-cpp17/all/conandata.yml new file mode 100644 index 0000000..b91ac85 --- /dev/null +++ b/pixelmatch-cpp17/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "1.0.3": + url: "https://github.com/jwmcglynn/pixelmatch-cpp17/archive/refs/tags/v1.0.3.tar.gz" + sha256: "7ed08fe1916413f88b4411a6bd510afb7e39260ce9f79c80373b252d01a80d1d" + "09102024": + url: "https://github.com/jwmcglynn/pixelmatch-cpp17/archive/bfc8c6c20cd89688f8b5412af7f89ad5e761d189.tar.gz" + sha256: "360c11ae82fc7dd70427d4a32fb3b8c5e2d5e9bd85dfb90933747967a898ab2d" + "23052024": + url: "https://github.com/jwmcglynn/pixelmatch-cpp17/archive/e65772b1a00d9fa4fe69d1553010f98f01e6156b.tar.gz" + sha256: "786ad1b1ec0323257002a6c100e00db55f305d8d4d92ff2ba5dbf846c687c67e" + "01082023": + url: "https://github.com/jwmcglynn/pixelmatch-cpp17/archive/5cec7dd16fa02babbc7efdccfb4d130ede29f621.tar.gz" + sha256: "a7224d397c61a3819e4e68188c338cbfe4b7f5513ad7b543b7d65e821296708d" +patches: + "1.0.3": + - patch_file: "patches/1.0.3-conan-dependencies.patch" + patch_description: "Include conan dependencies" + patch_type: "conan" \ No newline at end of file diff --git a/pixelmatch-cpp17/all/conanfile.py b/pixelmatch-cpp17/all/conanfile.py new file mode 100644 index 0000000..19b9976 --- /dev/null +++ b/pixelmatch-cpp17/all/conanfile.py @@ -0,0 +1,77 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class PixelMatchCPP17Conan(ConanFile): + name = "pixelmatch-cpp17" + description = "A C++17 port of the JavaScript pixelmatch library, providing a small pixel-level image comparison library." + license = "Apache-2.0" + topics = ("image", "comparison") + homepage = "https://github.com/jwmcglynn/pixelmatch-cpp17" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + CMakeDeps(self).generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + "LICENSE", + src=self._source_subfolder, + dst=os.path.join(self.package_folder, "licenses"), + ) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["pixelmatch-cpp17"] + + def requirements(self): + if(Version(self.version) == "1.0.3"): + self.requires("stb/cci.20240531", transitive_headers=True) diff --git a/pixelmatch-cpp17/all/patches/1.0.3-conan-dependencies.patch b/pixelmatch-cpp17/all/patches/1.0.3-conan-dependencies.patch new file mode 100644 index 0000000..3334bd3 --- /dev/null +++ b/pixelmatch-cpp17/all/patches/1.0.3-conan-dependencies.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f4ed9a7..a5b6a69 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,14 +6,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + + option(PIXELMATCH_BUILD_TESTS "Enable building tests" OFF) + +-# stb libraries for tests and image_utils. Not used in pixelmatch-cpp17 itself. +-add_library(pixelmatch_third_party_stb_image STATIC third_party/stb/stb_image.cpp) +-target_include_directories(pixelmatch_third_party_stb_image PUBLIC third_party) +-target_compile_options(pixelmatch_third_party_stb_image PRIVATE -Wno-unused-function -Wno-self-assign) +- +-add_library(pixelmatch_third_party_stb_image_write STATIC third_party/stb/stb_image_write.cpp) +-target_include_directories(pixelmatch_third_party_stb_image_write PUBLIC third_party) +-target_compile_options(pixelmatch_third_party_stb_image_write PRIVATE -Wno-unused-function -Wno-self-assign) ++find_package(stb) + + # Main library + add_library(pixelmatch-cpp17 src/pixelmatch/pixelmatch.cc) +@@ -22,16 +15,18 @@ target_include_directories(pixelmatch-cpp17 PUBLIC src) + # image_utils helper library (uses stb to load and save images) + add_library(image_utils src/pixelmatch/image_utils.cc) + target_include_directories(image_utils PUBLIC src) +-target_link_libraries(image_utils PUBLIC pixelmatch-cpp17 pixelmatch_third_party_stb_image pixelmatch_third_party_stb_image_write) ++target_link_libraries(image_utils PUBLIC pixelmatch-cpp17 stb::stb) ++ ++install(FILES src/pixelmatch/pixelmatch.h DESTINATION include/pixelmatch) ++install(TARGETS pixelmatch-cpp17 DESTINATION lib) ++ ++if ((MSVC) AND (MSVC_VERSION GREATER_EQUAL 1914)) ++ target_compile_options(${PROJECT_NAME} PRIVATE "/Zc:preprocessor") ++ target_compile_options(${PROJECT_NAME} PRIVATE "/Zc:__cplusplus") ++endif() + + if(PIXELMATCH_BUILD_TESTS) +-include(FetchContent) +-FetchContent_Declare( +- googletest +- URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip +-) +-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +-FetchContent_MakeAvailable(googletest) ++find_package(GTest) + + enable_testing() + add_library(test_base INTERFACE) +diff --git a/src/pixelmatch/image_utils.cc b/src/pixelmatch/image_utils.cc +index 74ec434..068e75d 100644 +--- a/src/pixelmatch/image_utils.cc ++++ b/src/pixelmatch/image_utils.cc +@@ -1,7 +1,7 @@ + #include "pixelmatch/image_utils.h" + +-#include +-#include ++#include ++#include + + #include + #include // For memcmp. diff --git a/pixelmatch-cpp17/all/test_package/CMakeLists.txt b/pixelmatch-cpp17/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..2914b13 --- /dev/null +++ b/pixelmatch-cpp17/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(pixelmatch-cpp17 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} pixelmatch-cpp17::pixelmatch-cpp17) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) \ No newline at end of file diff --git a/pixelmatch-cpp17/all/test_package/conanfile.py b/pixelmatch-cpp17/all/test_package/conanfile.py new file mode 100644 index 0000000..ef5d704 --- /dev/null +++ b/pixelmatch-cpp17/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + 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 can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/pixelmatch-cpp17/all/test_package/test_package.cpp b/pixelmatch-cpp17/all/test_package/test_package.cpp new file mode 100644 index 0000000..75ba27f --- /dev/null +++ b/pixelmatch-cpp17/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +int main() +{ + pixelmatch::pixelmatch( + {}, + {}, + {}, + 2, + 2, + 2); + return 0; +} diff --git a/pixelmatch-cpp17/config.yml b/pixelmatch-cpp17/config.yml new file mode 100644 index 0000000..10d4193 --- /dev/null +++ b/pixelmatch-cpp17/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.3": + folder: all + "09102024": + folder: all + "23052024": + folder: all + "01082023": + folder: all \ No newline at end of file diff --git a/rapidhash/all/conandata.yml b/rapidhash/all/conandata.yml new file mode 100644 index 0000000..9248957 --- /dev/null +++ b/rapidhash/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.0": + url: "https://github.com/Nicoshev/rapidhash/archive/refs/tags/rapidhash_v3.tar.gz" + sha256: "2e708bb2be76fd76f1e5d75bb3145d058e2dad0c5b0022646f84ec83aeff400d" + "1.0": + url: "https://github.com/Nicoshev/rapidhash/archive/refs/tags/rapidhash_v1.0.tar.gz" + sha256: "d295e66eec6745cc0e0c8c65fb8b5edf08ab3af83b0a503c54c6705144b53848" diff --git a/rapidhash/all/conanfile.py b/rapidhash/all/conanfile.py new file mode 100644 index 0000000..39748f5 --- /dev/null +++ b/rapidhash/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile + +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=2" + +class RapidHashConan(ConanFile): + name = "rapidhash" + description = "Very fast, high quality, platform-independent hashing algorithm" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Nicoshev/rapidhash" + topics = ("hash", "wyhash", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "rapidhash.h", + self.source_folder, + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/rapidhash/all/test_package/CMakeLists.txt b/rapidhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..e07f48f --- /dev/null +++ b/rapidhash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rapidhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidhash::rapidhash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/rapidhash/all/test_package/conanfile.py b/rapidhash/all/test_package/conanfile.py new file mode 100644 index 0000000..3a91c94 --- /dev/null +++ b/rapidhash/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/rapidhash/all/test_package/test_package.cpp b/rapidhash/all/test_package/test_package.cpp new file mode 100644 index 0000000..5bbba46 --- /dev/null +++ b/rapidhash/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "rapidhash.h" + +int main() { + std::string text = "Hello, rapidhash."; + + std::cout << rapidhash(text.data(), text.size()) << '\n'; + + return 0; +} diff --git a/rapidhash/config.yml b/rapidhash/config.yml new file mode 100644 index 0000000..e095fcd --- /dev/null +++ b/rapidhash/config.yml @@ -0,0 +1,5 @@ +versions: + "3.0": + folder: all + "1.0": + folder: all diff --git a/shaderc/all/conandata.yml b/shaderc/all/conandata.yml new file mode 100644 index 0000000..716b143 --- /dev/null +++ b/shaderc/all/conandata.yml @@ -0,0 +1,61 @@ +sources: + "2025.3": + url: "https://github.com/google/shaderc/archive/refs/tags/v2025.3.tar.gz" + sha256: "a8e4a25e5c2686fd36981e527ed05e451fcfc226bddf350f4e76181371190937" + "2024.1": + url: "https://github.com/google/shaderc/archive/refs/tags/v2024.1.tar.gz" + sha256: "eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528" + "2023.6": + url: "https://github.com/google/shaderc/archive/refs/tags/v2023.6.tar.gz" + sha256: "e40fd4a87a56f6610e223122179f086d5c4f11a7e0e2aa461f0325c3a0acc6ae" + "2021.1": + url: "https://github.com/google/shaderc/archive/v2021.1.tar.gz" + sha256: "047113bc4628da164a3cb845efc20d442728873f6054a68ab56d04a053f2c32b" +patches: + "2025.3": + - patch_file: "patches/2025.3/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" + "2024.1": + - patch_file: "patches/2023.6/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" + "2023.6": + - patch_file: "patches/2023.6/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" + "2021.1": + - patch_file: "patches/2021.1/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" +siprv_mapping: + # TODO: bump me once newer versions are available on CCI + "2025.3": "1.4.313.0" + "2024.1": "1.3.261.1" + # "2023.6": "1.3.261.1" + "2023.6": "1.3.239.0" + "2021.1": "1.3.224.0" diff --git a/shaderc/all/conanfile.py b/shaderc/all/conanfile.py new file mode 100644 index 0000000..eb98532 --- /dev/null +++ b/shaderc/all/conanfile.py @@ -0,0 +1,133 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class ShadercConan(ConanFile): + name = "shaderc" + description = "A collection of tools, libraries and tests for shader compilation." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/shaderc" + topics = ("glsl", "hlsl", "msl", "spirv", "spir-v", "glslc") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + @property + def _spirv_version(self): + return self.conan_data.get("siprv_mapping")[self.version] + + def requirements(self): + # transitive_headers=True is not required for any of the dependencies + self.requires(f"glslang/{self._spirv_version}") + self.requires(f"spirv-tools/{self._spirv_version}") + self.requires(f"spirv-headers/{self._spirv_version}") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.17.2 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["SHADERC_SKIP_INSTALL"] = False + tc.cache_variables["SHADERC_SKIP_EXAMPLES"] = True + tc.cache_variables["SHADERC_SKIP_TESTS"] = True + tc.cache_variables["ENABLE_CODE_COVERAGE"] = False + tc.cache_variables["SHADERC_ENABLE_WERROR_COMPILE"] = False + if is_msvc(self): + tc.cache_variables["SHADERC_ENABLE_SHARED_CRT"] = not is_msvc_static_runtime(self) + tc.generate() + + self.dependencies["glslang"].cpp_info.components["glslang-core"].includedirs.append( + os.path.join(self.dependencies["glslang"].package_folder, "include", "glslang") + ) + + deps = CMakeDeps(self) + deps.set_property("glslang::glslang-core", "cmake_target_name", "glslang") + deps.set_property("glslang::osdependent", "cmake_target_name", "OSDependent") + if(Version(self.version) < "2025.3"): + deps.set_property("glslang::oglcompiler", "cmake_target_name", "OGLCompiler") + deps.set_property("glslang::hlsl", "cmake_target_name", "HLSL") + deps.set_property("glslang::spirv", "cmake_target_name", "SPIRV") + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + if self.options.shared: + self.cpp_info.set_property("pkg_config_name", "shaderc") + self.cpp_info.libs = ["shaderc_shared"] + self.cpp_info.defines.append("SHADERC_SHAREDLIB") + else: + self.cpp_info.set_property("pkg_config_name", "shaderc_static") + self.cpp_info.libs = ["shaderc", "shaderc_util"] + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + self.cpp_info.requires = [ + "glslang::glslang-core", + "glslang::osdependent", + *(["glslang::oglcompiler", "glslang::hlsl"] if Version(self.version) < Version("2025.3") else []), + "spirv-tools::spirv-tools-core", + "spirv-tools::spirv-tools-opt", + "spirv-headers::spirv-headers" + ] + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) diff --git a/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch b/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch new file mode 100644 index 0000000..a53d4b7 --- /dev/null +++ b/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch @@ -0,0 +1,25 @@ +diff --git a/utils/update_build_version.py b/utils/update_build_version.py +--- a/utils/update_build_version.py ++++ b/utils/update_build_version.py +@@ -128,18 +128,18 @@ + + + def main(): +- if len(sys.argv) != 5: ++ if len(sys.argv) < 5: + print(('usage: {} '.format( + sys.argv[0]))) + sys.exit(1) + +- projects = ['shaderc', 'spirv-tools', 'glslang'] ++ projects = ['shaderc'] + new_content = ''.join([ + '"{}\\n"\n'.format(get_version_string(p, d)) + for (p, d) in zip(projects, sys.argv[1:]) + ]) + +- output_file = sys.argv[4] ++ output_file = sys.argv[-1] + mkdir_p(os.path.dirname(output_file)) + + if os.path.isfile(output_file): diff --git a/shaderc/all/patches/2021.1/install-shaderc_util.patch b/shaderc/all/patches/2021.1/install-shaderc_util.patch new file mode 100644 index 0000000..c280627 --- /dev/null +++ b/shaderc/all/patches/2021.1/install-shaderc_util.patch @@ -0,0 +1,14 @@ +diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt +--- a/libshaderc_util/CMakeLists.txt ++++ b/libshaderc_util/CMakeLists.txt +@@ -87,3 +87,10 @@ + add_dependencies(shaderc_util_file_finder_test testdata) + add_dependencies(shaderc_util_io_shaderc_test testdata) + endif() ++ ++if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) ++ install(TARGETS shaderc_util ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() diff --git a/shaderc/all/patches/2021.1/use-conan-dependencies.patch b/shaderc/all/patches/2021.1/use-conan-dependencies.patch new file mode 100644 index 0000000..667cfb6 --- /dev/null +++ b/shaderc/all/patches/2021.1/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,7 +112,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/shaderc/all/patches/2023.6/use-conan-dependencies.patch b/shaderc/all/patches/2023.6/use-conan-dependencies.patch new file mode 100644 index 0000000..b285174 --- /dev/null +++ b/shaderc/all/patches/2023.6/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,7 +120,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/shaderc/all/patches/2025.3/use-conan-dependencies.patch b/shaderc/all/patches/2025.3/use-conan-dependencies.patch new file mode 100644 index 0000000..70b7267 --- /dev/null +++ b/shaderc/all/patches/2025.3/use-conan-dependencies.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06f5395..76e5179 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -130,7 +130,12 @@ endif(MSVC) + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/shaderc/all/test_package/CMakeLists.txt b/shaderc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..e88a76f --- /dev/null +++ b/shaderc/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX C) + +find_package(shaderc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_shaderc_c test_package_shaderc.c) +target_link_libraries(${PROJECT_NAME}_shaderc_c PRIVATE shaderc::shaderc) + +add_executable(${PROJECT_NAME}_shaderc_cpp test_package_shaderc.cpp) +target_link_libraries(${PROJECT_NAME}_shaderc_cpp PRIVATE shaderc::shaderc) +set_property(TARGET ${PROJECT_NAME}_shaderc_cpp PROPERTY CXX_STANDARD 11) diff --git a/shaderc/all/test_package/conanfile.py b/shaderc/all/test_package/conanfile.py new file mode 100644 index 0000000..4613db3 --- /dev/null +++ b/shaderc/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + # Test programs consuming shaderc lib + bin_path_shaderc_c = os.path.join(self.cpp.build.bindir, "test_package_shaderc_c") + self.run(bin_path_shaderc_c, env="conanrun") + + bin_path_shaderc_cpp = os.path.join(self.cpp.build.bindir, "test_package_shaderc_cpp") + self.run(bin_path_shaderc_cpp, env="conanrun") + + # Test glslc executable + self.run(f"glslc -h", env="conanrun") diff --git a/shaderc/all/test_package/test_package_shaderc.c b/shaderc/all/test_package/test_package_shaderc.c new file mode 100644 index 0000000..6a83dd0 --- /dev/null +++ b/shaderc/all/test_package/test_package_shaderc.c @@ -0,0 +1,8 @@ +#include + +int main() { + shaderc_compiler_t shaderc_compiler = shaderc_compiler_initialize(); + shaderc_compiler_release(shaderc_compiler); + + return 0; +} diff --git a/shaderc/all/test_package/test_package_shaderc.cpp b/shaderc/all/test_package/test_package_shaderc.cpp new file mode 100644 index 0000000..d6defef --- /dev/null +++ b/shaderc/all/test_package/test_package_shaderc.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + shaderc::Compiler compiler; + shaderc::CompileOptions compile_options; + + return 0; +} diff --git a/shaderc/config.yml b/shaderc/config.yml new file mode 100644 index 0000000..57ee5e6 --- /dev/null +++ b/shaderc/config.yml @@ -0,0 +1,9 @@ +versions: + "2025.3": + folder: all + "2024.1": + folder: all + "2023.6": + folder: all + "2021.1": + folder: all diff --git a/sqlite3/all/CMakeLists.txt b/sqlite3/all/CMakeLists.txt new file mode 100644 index 0000000..d6c445f --- /dev/null +++ b/sqlite3/all/CMakeLists.txt @@ -0,0 +1,231 @@ +cmake_minimum_required(VERSION 3.15) +project(sqlite3 LANGUAGES C) + +# Add some options from https://sqlite.org/compile.html +option(SQLITE3_BUILD_EXECUTABLE "Build sqlite command line utility for accessing SQLite databases") +option(ENABLE_JSON1 "Enable JSON SQL functions") +option(ENABLE_COLUMN_METADATA "Enable additional APIs that provide convenient access to meta-data about tables and queries") +option(ENABLE_DBSTAT_VTAB "Enable the DBSTAT virtual table") +option(ENABLE_EXPLAIN_COMMENTS "Enable SQLite to insert comment text into the output of EXPLAIN") +option(ENABLE_FTS3 "Enable version 3 of the full-text search engine") +option(ENABLE_FTS3_PARENTHESIS "Kodifies the query pattern parser in FTS3 such that it supports operators AND and NOT (in addition to the usual OR and NEAR) and also allows query expressions to contain nested parenthesis") +option(ENABLE_FTS4 "Enable version 3 and 4 of the full-text search engine") +option(ENABLE_FTS5 "Enable version 5 of the full-text search engine") +option(ENABLE_ICU "Enable support for the ICU extension") +option(ENABLE_MEMSYS5 "Enable MEMSYS5 memory allocator") +option(ENABLE_SOUNDEX "Enable the soundex() SQL function") +option(ENABLE_PREUPDATE_HOOK "Enables APIs to handle any change to a rowid table") +option(ENABLE_RTREE "Enable support for the R*Tree index extension") +option(ENABLE_UNLOCK_NOTIFY "Enable support for the unlock notify API") +option(ENABLE_DEFAULT_SECURE_DELETE "Turns on secure deletion by default") +option(USE_ALLOCA "The alloca() memory allocator will be used in a few situations where it is appropriate.") +option(USE_URI "This option causes the URI filename process logic to be enabled by default.") +option(OMIT_LOAD_EXTENSION "Omits the entire extension loading mechanism from SQLite") +option(OMIT_DEPRECATED "Omits deprecated interfaces and features") +if(SQLITE3_VERSION VERSION_GREATER_EQUAL "3.35.0") + option(ENABLE_MATH_FUNCTIONS "Enables the built-in SQL math functions" ON) +else() + set(ENABLE_MATH_FUNCTIONS OFF) +endif() +option(HAVE_FDATASYNC "Use fdatasync() instead of fsync() on unix systems") +option(HAVE_GMTIME_R "Use the threadsafe gmtime_r()") +option(HAVE_LOCALTIME_R "Use the threadsafe localtime_r()") +option(HAVE_POSIX_FALLOCATE "Use posix_fallocate()") +option(HAVE_STRERROR_R "Use strerror_r()") +option(HAVE_USLEEP "Use usleep() system call to implement the xSleep method") +option(DISABLE_GETHOSTUUID "Disable function gethostuuid") +set(MAX_COLUMN CACHE STRING "The maximum number of columns in a table / index / view") +set(MAX_VARIABLE_NUMBER CACHE STRING "The maximum value of a ?nnn wildcard that the parser will accept") +set(MAX_BLOB_SIZE CACHE STRING "Set the maximum number of bytes in a string or BLOB") +option(DISABLE_DEFAULT_VFS "Disable default VFS implementation") +option(ENABLE_DBPAGE_VTAB "The SQLITE_DBPAGE extension implements an eponymous-only virtual table that provides direct access to the underlying database file by interacting with the pager. SQLITE_DBPAGE is capable of both reading and writing any page of the database. Because interaction is through the pager layer, all changes are transactional.") + +add_library(${PROJECT_NAME} ${SQLITE3_SRC_DIR}/sqlite3.c) +set_target_properties(${PROJECT_NAME} PROPERTIES C_VISIBILITY_PRESET hidden) +if(BUILD_SHARED_LIBS) + if(WIN32) + target_compile_definitions(${PROJECT_NAME} + PRIVATE "SQLITE_API=__declspec(dllexport)" + INTERFACE "SQLITE_API=__declspec(dllimport)" + ) + else() + target_compile_definitions(${PROJECT_NAME} + PUBLIC "SQLITE_API=__attribute__((visibility(\"default\")))" + ) + endif() +endif() +if(ENABLE_JSON1) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_JSON1) +endif() +if(ENABLE_COLUMN_METADATA) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_COLUMN_METADATA) +endif() +if(ENABLE_DBSTAT_VTAB) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_DBSTAT_VTAB) +endif() +if(ENABLE_EXPLAIN_COMMENTS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_EXPLAIN_COMMENTS) +endif() +if(ENABLE_FTS3) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS3) +endif() +if(ENABLE_FTS3_PARENTHESIS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS3_PARENTHESIS) +endif() +if(ENABLE_FTS4) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS4) +endif() +if(ENABLE_FTS5) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS5) +endif() +if(ENABLE_ICU) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_ICU) +endif() +if(ENABLE_PREUPDATE_HOOK) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_PREUPDATE_HOOK) +endif() +if(ENABLE_RTREE) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_RTREE) +endif() +if(ENABLE_UNLOCK_NOTIFY) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_UNLOCK_NOTIFY) +endif() +if(ENABLE_DEFAULT_SECURE_DELETE) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_SECURE_DELETE) +endif() +if(ENABLE_MEMSYS5) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_MEMSYS5) +endif() +if(ENABLE_SOUNDEX) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_SOUNDEX) +endif() +if(USE_ALLOCA) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_USE_ALLOCA) +endif() +if(USE_URI) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_USE_URI) +endif() +if(OMIT_LOAD_EXTENSION) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OMIT_LOAD_EXTENSION) +endif() +if (OMIT_DEPRECATED) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OMIT_DEPRECATED) +endif() +if(ENABLE_MATH_FUNCTIONS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_MATH_FUNCTIONS) +endif() +if(HAVE_FDATASYNC) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_FDATASYNC) +endif() +if(HAVE_GMTIME_R) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_GMTIME_R) +endif() +if(HAVE_LOCALTIME_R) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_LOCALTIME_R) +endif() +if(HAVE_POSIX_FALLOCATE) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_POSIX_FALLOCATE) +endif() +if(HAVE_STRERROR_R) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_STRERROR_R) +endif() +if(HAVE_USLEEP) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_USLEEP) +endif() +if(DISABLE_GETHOSTUUID) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_GETHOSTUUID=0) +endif() +target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_THREADSAFE=${THREADSAFE}) +if(MAX_COLUMN) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_MAX_COLUMN=${MAX_COLUMN}) +endif() +if(MAX_VARIABLE_NUMBER) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_MAX_VARIABLE_NUMBER=${MAX_VARIABLE_NUMBER}) +endif() +if(MAX_BLOB_SIZE) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_MAX_LENGTH=${MAX_BLOB_SIZE}) +endif() +if(DISABLE_DEFAULT_VFS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OS_OTHER=1) +endif() +if(ENABLE_DBPAGE_VTAB) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_DBPAGE_VTAB) +endif() + +if(THREADSAFE) + find_package(Threads REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) +endif() + +if(ENABLE_ICU) + find_package(ICU REQUIRED COMPONENTS data i18n uc) + target_link_libraries(${PROJECT_NAME} PRIVATE ICU::i18n ICU::uc ICU::data) + enable_language(CXX) # required for linking language since ICU has c++ code +endif() + +if(NOT OMIT_LOAD_EXTENSION) + target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS}) +endif() + +set(SQLITE3_LIBRARY_NEEDS_MATH FALSE) +if(ENABLE_FTS5 OR ENABLE_MATH_FUNCTIONS) + set(SQLITE3_LIBRARY_NEEDS_MATH TRUE) +endif() + +set(SQLITE3_EXECUTABLE_NEEDS_MATH FALSE) +if(SQLITE3_BUILD_EXECUTABLE AND SQLITE3_VERSION VERSION_GREATER_EQUAL "3.49.2") + set(SQLITE3_EXECUTABLE_NEEDS_MATH TRUE) +endif() + +set(NEED_MATH_LIBRARY FALSE) +if(SQLITE3_LIBRARY_NEEDS_MATH OR SQLITE3_EXECUTABLE_NEEDS_MATH) + set(NEED_MATH_LIBRARY TRUE) +endif() + +if(NEED_MATH_LIBRARY) + include(CheckLibraryExists) + # Check if math functionality is on the separate 'libm' library, + # otherwise assume that it is already part of the C runtime. + # The `m` library is part of the compiler toolchain, this checks + # if the compiler can successfully link against the library. + check_library_exists(m log "" HAVE_MATH_LIBRARY) +endif() + +if(SQLITE3_LIBRARY_NEEDS_MATH AND HAVE_MATH_LIBRARY) + target_link_libraries(${PROJECT_NAME} PRIVATE m) +endif() + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(DIRECTORY ${SQLITE3_SRC_DIR}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") + +if(SQLITE3_BUILD_EXECUTABLE) + add_executable(sqlite3-bin ${SQLITE3_SRC_DIR}/shell.c) + target_link_libraries(sqlite3-bin PRIVATE ${PROJECT_NAME}) + if(SQLITE3_EXECUTABLE_NEEDS_MATH AND HAVE_MATH_LIBRARY) + target_link_libraries(sqlite3-bin PRIVATE m) + endif() + if(ENABLE_DBPAGE_VTAB) + target_compile_definitions(sqlite3-bin PRIVATE SQLITE_ENABLE_DBPAGE_VTAB) + endif() + if(ENABLE_ICU) + set_target_properties(sqlite3-bin PROPERTIES LINKER_LANGUAGE CXX) + endif() + if (MSVC) + # Prevent issue where an import library may be generated on Windows + # fatal error LNK1149: output filename matches input filename '\build\Release\sqlite3.lib'\ + target_link_options(sqlite3-bin PRIVATE "/noimplib") + endif() + set_target_properties(sqlite3-bin PROPERTIES OUTPUT_NAME "sqlite3" PDB_NAME "sqlite3-bin") + include(CheckSymbolExists) + check_symbol_exists(system "stdlib.h" HAVE_SYSTEM) + if(NOT HAVE_SYSTEM) + target_compile_definitions(sqlite3-bin PRIVATE SQLITE_NOHAVE_SYSTEM) + endif() + install(TARGETS sqlite3-bin DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/sqlite3/all/cmake/SQLite3CLITargets.cmake b/sqlite3/all/cmake/SQLite3CLITargets.cmake new file mode 100644 index 0000000..2f7abca --- /dev/null +++ b/sqlite3/all/cmake/SQLite3CLITargets.cmake @@ -0,0 +1,21 @@ +if(NOT TARGET SQLite::SQLite3CLI) + if(CMAKE_CROSSCOMPILING) + find_program(SQLITE3_EXECUTABLE + NAMES sqlite3 + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(SQLITE3_EXECUTABLE + NAMES sqlite3 + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + NO_DEFAULT_PATH + ) + endif() + + if(SQLITE3_EXECUTABLE) + get_filename_component(SQLITE3_EXECUTABLE "${SQLITE3_EXECUTABLE}" ABSOLUTE) + add_executable(SQLite::SQLite3CLI IMPORTED) + set_property(TARGET SQLite::SQLite3CLI PROPERTY IMPORTED_LOCATION ${SQLITE3_EXECUTABLE}) + endif() +endif() diff --git a/sqlite3/all/conandata.yml b/sqlite3/all/conandata.yml new file mode 100644 index 0000000..533f4e0 --- /dev/null +++ b/sqlite3/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "3.51.0": + url: "https://sqlite.org/2025/sqlite-amalgamation-3510000.zip" + sha256: "1caf7116f2910600d04473ad69d37ec538fa62fa36adccd37b5e0e43647c98be" + "3.50.4": + url: "https://sqlite.org/2025/sqlite-amalgamation-3500400.zip" + sha256: "1d3049dd0f830a025a53105fc79fd2ab9431aea99e137809d064d8ee8356b032" + "3.49.2": + url: "https://sqlite.org/2025/sqlite-amalgamation-3490200.zip" + sha256: "921fc725517a694df7df38a2a3dfede6684024b5788d9de464187c612afb5918" + "3.45.3": + url: "https://sqlite.org/2024/sqlite-amalgamation-3450300.zip" + sha256: "ea170e73e447703e8359308ca2e4366a3ae0c4304a8665896f068c736781c651" + "3.44.2": + url: "https://sqlite.org/2023/sqlite-amalgamation-3440200.zip" + sha256: "833be89b53b3be8b40a2e3d5fedb635080e3edb204957244f3d6987c2bb2345f" \ No newline at end of file diff --git a/sqlite3/all/conanfile.py b/sqlite3/all/conanfile.py new file mode 100644 index 0000000..7c14d28 --- /dev/null +++ b/sqlite3/all/conanfile.py @@ -0,0 +1,214 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, load, save, copy +import os + +required_conan_version = ">=1.53.0" + + +class Sqlite3Conan(ConanFile): + name = "sqlite3" + description = "Self-contained, serverless, in-process SQL database engine." + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.sqlite.org" + topics = ("sqlite", "database", "sql", "serverless") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threadsafe": [0, 1, 2], + "enable_column_metadata": [True, False], + "enable_dbstat_vtab": [True, False], + "enable_explain_comments": [True, False], + "enable_fts3": [True, False], + "enable_fts3_parenthesis": [True, False], + "enable_fts4": [True, False], + "enable_fts5": [True, False], + "enable_icu": [True, False], + "enable_json1": [True, False], + "enable_memsys5": [True, False], + "enable_soundex": [True, False], + "enable_preupdate_hook": [True, False], + "enable_rtree": [True, False], + "use_alloca": [True, False], + "use_uri": [True, False], + "omit_load_extension": [True, False], + "omit_deprecated": [True, False], + "enable_math_functions": [True, False], + "enable_unlock_notify": [True, False], + "enable_default_secure_delete": [True, False], + "disable_gethostuuid": [True, False], + "max_column": [None, "ANY"], + "max_variable_number": [None, "ANY"], + "max_blob_size": [None, "ANY"], + "build_executable": [True, False], + "enable_default_vfs": [True, False], + "enable_dbpage_vtab": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threadsafe": 1, + "enable_column_metadata": True, + "enable_dbstat_vtab": False, + "enable_explain_comments": False, + "enable_fts3": False, + "enable_fts3_parenthesis": False, + "enable_fts4": False, + "enable_fts5": False, + "enable_icu": False, + "enable_json1": False, + "enable_memsys5": False, + "enable_soundex": False, + "enable_preupdate_hook": False, + "enable_rtree": True, + "use_alloca": False, + "use_uri": False, + "omit_load_extension": False, + "omit_deprecated": False, + "enable_math_functions": True, + "enable_unlock_notify": True, + "enable_default_secure_delete": False, + "disable_gethostuuid": False, + "max_column": None, # Uses default value from source + "max_variable_number": None, # Uses default value from source + "max_blob_size": None, # Uses default value from source + "build_executable": True, + "enable_default_vfs": True, + "enable_dbpage_vtab": False, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + 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 requirements(self): + if self.options.enable_icu: + self.requires("icu/75.1") + + def validate(self): + if self.options.build_executable: + if not self.options.enable_default_vfs: + # Need to provide custom VFS code: https://www.sqlite.org/custombuild.html + raise ConanInvalidConfiguration("build_executable=True cannot be combined with enable_default_vfs=False") + if self.options.omit_load_extension: + raise ConanInvalidConfiguration("build_executable=True requires omit_load_extension=True") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SQLITE3_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["SQLITE3_VERSION"] = self.version + tc.variables["SQLITE3_BUILD_EXECUTABLE"] = self.options.build_executable + tc.variables["THREADSAFE"] = self.options.threadsafe + tc.variables["ENABLE_COLUMN_METADATA"] = self.options.enable_column_metadata + tc.variables["ENABLE_DBSTAT_VTAB"] = self.options.enable_dbstat_vtab + tc.variables["ENABLE_EXPLAIN_COMMENTS"] = self.options.enable_explain_comments + tc.variables["ENABLE_FTS3"] = self.options.enable_fts3 + tc.variables["ENABLE_FTS3_PARENTHESIS"] = self.options.enable_fts3_parenthesis + tc.variables["ENABLE_FTS4"] = self.options.enable_fts4 + tc.variables["ENABLE_FTS5"] = self.options.enable_fts5 + tc.variables["ENABLE_ICU"] = self.options.enable_icu + tc.variables["ENABLE_JSON1"] = self.options.enable_json1 + tc.variables["ENABLE_MEMSYS5"] = self.options.enable_memsys5 + tc.variables["ENABLE_PREUPDATE_HOOK"] = self.options.enable_preupdate_hook + tc.variables["ENABLE_SOUNDEX"] = self.options.enable_soundex + tc.variables["ENABLE_RTREE"] = self.options.enable_rtree + tc.variables["ENABLE_UNLOCK_NOTIFY"] = self.options.enable_unlock_notify + tc.variables["ENABLE_DEFAULT_SECURE_DELETE"] = self.options.enable_default_secure_delete + tc.variables["USE_ALLOCA"] = self.options.use_alloca + tc.variables["USE_URI"] = self.options.use_uri + tc.variables["OMIT_LOAD_EXTENSION"] = self.options.omit_load_extension + tc.variables["OMIT_DEPRECATED"] = self.options.omit_deprecated + tc.variables["ENABLE_MATH_FUNCTIONS"] = self.options.enable_math_functions + tc.variables["HAVE_FDATASYNC"] = True + tc.variables["HAVE_GMTIME_R"] = True + tc.variables["HAVE_LOCALTIME_R"] = self.settings.os != "Windows" + tc.variables["HAVE_POSIX_FALLOCATE"] = not (self.settings.os in ["Windows", "Android"] or is_apple_os(self)) + tc.variables["HAVE_STRERROR_R"] = True + tc.variables["HAVE_USLEEP"] = True + tc.variables["DISABLE_GETHOSTUUID"] = self.options.disable_gethostuuid + if self.options.max_column: + tc.variables["MAX_COLUMN"] = self.options.max_column + if self.options.max_variable_number: + tc.variables["MAX_VARIABLE_NUMBER"] = self.options.max_variable_number + if self.options.max_blob_size: + tc.variables["MAX_BLOB_SIZE"] = self.options.max_blob_size + tc.variables["DISABLE_DEFAULT_VFS"] = not self.options.enable_default_vfs + tc.variables["ENABLE_DBPAGE_VTAB"] = self.options.enable_dbpage_vtab + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def _extract_license(self): + header = load(self, os.path.join(self.source_folder, "sqlite3.h")) + license_content = header[3:header.find("***", 1)] + return license_content + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + copy(self, "SQLite3CLITargets.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, self._module_path)) + + def export_sources(self): + copy(self, os.path.join("cmake", "SQLite3CLITargets.cmake"), self.recipe_folder, self.export_sources_folder) + + @property + def _module_path(self): + return os.path.join(self.package_folder, "lib", "cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "SQLite3") + self.cpp_info.set_property("cmake_target_name", "SQLite::SQLite3") + self.cpp_info.set_property("pkg_config_name", "sqlite3") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["sqlite"].libs = ["sqlite3"] + if self.options.enable_icu: + self.cpp_info.components["sqlite"].requires = ["icu::icu"] + if self.options.omit_load_extension: + self.cpp_info.components["sqlite"].defines.append("SQLITE_OMIT_LOAD_EXTENSION") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.threadsafe: + self.cpp_info.components["sqlite"].system_libs.append("pthread") + if not self.options.omit_load_extension: + self.cpp_info.components["sqlite"].system_libs.append("dl") + if self.options.enable_fts5 or self.options.get_safe("enable_math_functions"): + self.cpp_info.components["sqlite"].system_libs.append("m") + elif self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["sqlite"].defines.append("SQLITE_API=__declspec(dllimport)") + + self.cpp_info.components["sqlite"].set_property("cmake_target_name", "SQLite::SQLite3") + self.cpp_info.components["sqlite"].set_property("pkg_config_name", "sqlite3") + + if self.options.build_executable: + build_modules = [ + os.path.join(self._module_path, "SQLite3CLITargets.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) diff --git a/sqlite3/all/test_package/CMakeLists.txt b/sqlite3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..5f2ef27 --- /dev/null +++ b/sqlite3/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(SQLite3 REQUIRED) + +if(NOT SQLite3_INCLUDE_DIRS) + message(FATAL_ERROR "SQLite3_INCLUDE_DIRS CMake variable expected, but not defined") +endif() + +if(NOT SQLite3_LIBRARIES) + message(FATAL_ERROR "SQLite3_LIBRARIES CMake variable expected, but not defined") +endif() + +find_program(SQLITE3_EXECUTABLE NAMES sqlite3) +execute_process(COMMAND ${SQLITE3_EXECUTABLE} --version) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + diff --git a/sqlite3/all/test_package/conanfile.py b/sqlite3/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/sqlite3/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "CMakeToolchain", "CMakeDeps", "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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/sqlite3/all/test_package/test_package.c b/sqlite3/all/test_package/test_package.c new file mode 100644 index 0000000..e6a15ae --- /dev/null +++ b/sqlite3/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("SQLite Version: %s\n", sqlite3_libversion()); + return 0; +} diff --git a/sqlite3/config.yml b/sqlite3/config.yml new file mode 100644 index 0000000..90616d6 --- /dev/null +++ b/sqlite3/config.yml @@ -0,0 +1,11 @@ +versions: + "3.51.0": + folder: all + "3.50.4": + folder: all + "3.49.2": + folder: all + "3.45.3": + folder: all + "3.44.2": + folder: all diff --git a/stduuid/all/conandata.yml b/stduuid/all/conandata.yml new file mode 100644 index 0000000..1060084 --- /dev/null +++ b/stduuid/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.2.3": + url: "https://github.com/mariusbancila/stduuid/archive/v1.2.3.tar.gz" + sha256: "b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3" + "1.2.2": + url: "https://github.com/mariusbancila/stduuid/archive/v1.2.2.tar.gz" + sha256: "f554f6a9fe4d852fa217de6ab977afbf3f49e4a1dcb263afd61a94253c4c7a48" + "1.0": + url: "https://github.com/mariusbancila/stduuid/archive/v1.0.tar.gz" + sha256: "e96f2ac7c950c3c24d7e2e44a84236277b7774ee346dcc620edf400d9eda0a3c" +patches: + "1.2.2": + - patch_file: "patches/1.2.2-handle-span-header.patch" + patch_description: "Conditionally include span header based on compiler definition" + patch_type: "conan" + "1.2.3": + - patch_file: "patches/1.2.3-handle-span-header.patch" + patch_description: "Conditionally include span header based on compiler definition" + patch_type: "conan" diff --git a/stduuid/all/conanfile.py b/stduuid/all/conanfile.py new file mode 100644 index 0000000..b302ad1 --- /dev/null +++ b/stduuid/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class StduuidConan(ConanFile): + name = "stduuid" + description = "A C++17 cross-platform implementation for UUIDs" + topics = ("uuid", "guid", "header-only") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mariusbancila/stduuid" + settings = "os", "arch", "compiler", "build_type" + options = { + # True: Use std::span + # False: Use gsl::span + "with_cxx20_span": [True, False], + "with_system_generator": [True, False], + } + + @property + def _min_cppstd(self): + return "20" if self.options.get_safe("with_cxx20_span") else "17" + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "5", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def config_options(self): + if Version(self.version) == "1.0": + # Version 1.0 unconditionally depends on gsl span + del self.options.with_cxx20_span + else: + # Conditionally set the default value of with_cxx20_span + # if cppstd is set and is 20 or greater + self.options.with_cxx20_span = (self.settings.compiler.get_safe("cppstd", False) + and valid_min_cppstd(self, 20)) + + def requirements(self): + if not self.options.get_safe("with_cxx20_span") or Version(self.version) == "1.0": + self.requires("ms-gsl/4.0.0", transitive_headers=True) + if self.settings.os == "Linux" and Version(self.version) <= "1.0": + self.requires("util-linux-libuuid/2.39", transitive_headers=True, transitive_libs=True) + if self.settings.os == "Linux" and Version(self.version) == "1.2.3" and self.options.get_safe("with_system_generator"): + self.requires("libuuid/1.0.3", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "uuid.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.get_safe("with_cxx20_span"): + self.cpp_info.defines.append("LIBUUID_CPP20_OR_GREATER") + if self.options.get_safe("with_system_generator"): + self.cpp_info.defines.append("UUID_SYSTEM_GENERATOR") diff --git a/stduuid/all/patches/1.2.2-handle-span-header.patch b/stduuid/all/patches/1.2.2-handle-span-header.patch new file mode 100644 index 0000000..840c781 --- /dev/null +++ b/stduuid/all/patches/1.2.2-handle-span-header.patch @@ -0,0 +1,26 @@ +diff --git a/include/uuid.h b/include/uuid.h +index 600846f..5f00a49 100644 +--- a/include/uuid.h ++++ b/include/uuid.h +@@ -15,7 +15,11 @@ + #include + #include + #include +-#include ++#if defined(LIBUUID_CPP20_OR_GREATER) ++# include ++#else ++# include ++#endif + + #ifdef _WIN32 + +@@ -51,7 +55,7 @@ + + namespace uuids + { +-#ifdef __cpp_lib_span ++#if defined(LIBUUID_CPP20_OR_GREATER) + template + using span = std::span; + #else diff --git a/stduuid/all/patches/1.2.3-handle-span-header.patch b/stduuid/all/patches/1.2.3-handle-span-header.patch new file mode 100644 index 0000000..fae5f65 --- /dev/null +++ b/stduuid/all/patches/1.2.3-handle-span-header.patch @@ -0,0 +1,29 @@ +diff --git a/include/uuid.h b/include/uuid.h +index d48059d..4d14e4d 100644 +--- a/include/uuid.h ++++ b/include/uuid.h +@@ -17,15 +17,6 @@ + #include + #include + +-#ifdef __cplusplus +- +-# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +-# define LIBUUID_CPP20_OR_GREATER +-# endif +- +-#endif +- +- + #ifdef LIBUUID_CPP20_OR_GREATER + #include + #else +@@ -66,7 +57,7 @@ + + namespace uuids + { +-#ifdef __cpp_lib_span ++#if defined(LIBUUID_CPP20_OR_GREATER) + template + using span = std::span; + #else diff --git a/stduuid/all/test_package/CMakeLists.txt b/stduuid/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..f32f912 --- /dev/null +++ b/stduuid/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(stduuid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE stduuid::stduuid) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(stduuid_VERSION VERSION_LESS "1.1") + target_compile_definitions(${PROJECT_NAME} PRIVATE STDUUID_LT_1_1) +endif() diff --git a/stduuid/all/test_package/conanfile.py b/stduuid/all/test_package/conanfile.py new file mode 100644 index 0000000..98ab558 --- /dev/null +++ b/stduuid/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/stduuid/all/test_package/test_package.cpp b/stduuid/all/test_package/test_package.cpp new file mode 100644 index 0000000..160cf9b --- /dev/null +++ b/stduuid/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include + +#include +#include +#include +#include +#include + +int main() { + { + auto str = "47183823-2574-4bfd-b411-99ed177d3e43"; + auto guid = uuids::uuid::from_string(str); +#ifdef STDUUID_LT_1_1 + assert(uuids::to_string(guid) == str); +#else + assert(uuids::to_string(guid.value()) == str); +#endif + } + + { + std::random_device rd; + auto seed_data = std::array {}; + std::generate(std::begin(seed_data), std::end(seed_data), std::ref(rd)); + std::seed_seq seq(std::begin(seed_data), std::end(seed_data)); + std::mt19937 generator(seq); + + uuids::uuid const guid = uuids::uuid_random_generator{generator}(); + assert(!guid.is_nil()); +#ifdef STDUUID_LT_1_1 + assert(guid.size() == 16); +#else + assert(guid.as_bytes().size() == 16); +#endif + assert(guid.version() == uuids::uuid_version::random_number_based); + assert(guid.variant() == uuids::uuid_variant::rfc); + } + + return 0; +} diff --git a/stduuid/all/test_v1_package/CMakeLists.txt b/stduuid/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..b21cc49 --- /dev/null +++ b/stduuid/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/stduuid/all/test_v1_package/conanfile.py b/stduuid/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/stduuid/all/test_v1_package/conanfile.py @@ -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) diff --git a/stduuid/config.yml b/stduuid/config.yml new file mode 100644 index 0000000..a7bd154 --- /dev/null +++ b/stduuid/config.yml @@ -0,0 +1,7 @@ +versions: + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.0": + folder: all diff --git a/unordered_dense/all/conandata.yml b/unordered_dense/all/conandata.yml new file mode 100644 index 0000000..558c600 --- /dev/null +++ b/unordered_dense/all/conandata.yml @@ -0,0 +1,55 @@ +sources: + "4.8.1": + url: "https://github.com/martinus/unordered_dense/archive/v4.8.1.tar.gz" + sha256: "9f7202ec6d8353932ef865d33f5872e4b7a1356e9032da7cd09c3a0c5bb2b7de" + "4.7.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.7.0.tar.gz" + sha256: "73ce8ec4784619be4d6e54f2c4cb95d4d8dbc1fbbf24b5cf1e93b157bfa1043d" + "4.6.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.6.0.tar.gz" + sha256: "f8c1787cc8ce9028f02e2a09fefbb6c89d5fa3fd4c2c3475faabbb531c9b2ab0" + "4.5.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.5.0.tar.gz" + sha256: "2364ce4bc4c23bd02549bbb3a7572d881684cd46057f3737fd53be53669743aa" + "4.4.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.4.0.tar.gz" + sha256: "3976399793e8cb4db1409ce15610fbd9e5e406ced4745f262d393a9311efbd88" + "4.3.1": + url: "https://github.com/martinus/unordered_dense/archive/v4.3.1.tar.gz" + sha256: "ff069b0b7697a3601cd674e4a4405edc6ec1d60a5cc3e7fff18db9e24ecc8ec3" + "4.3.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.3.0.tar.gz" + sha256: "c8ffaf5277dd5c29871cc6359af7823c8137158d47511dd00c8193af84906b9c" + "4.1.2": + url: "https://github.com/martinus/unordered_dense/archive/v4.1.2.tar.gz" + sha256: "300410dbcd32800f83b2113dfecbdfe8cd256caa4cfeb117d646021d6e3209ae" + "4.1.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.1.0.tar.gz" + sha256: "0f594cb3b08fc657db3843139000005b6827e5c69d00f5c8d74c1239bd21746f" + "4.0.4": + url: "https://github.com/martinus/unordered_dense/archive/v4.0.4.tar.gz" + sha256: "b34a8c942963e3a647f1bbc192a6391cd56d7ae615b2ddc1601c1779b5792206" + "4.0.1": + url: "https://github.com/martinus/unordered_dense/archive/v4.0.1.tar.gz" + sha256: "6c8be4f76fed592f8c1ae07ce07eaa8749ed3a929a84a502764564dcbcc53a76" + "4.0.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.0.0.tar.gz" + sha256: "c9d43bfc60ed03e9aa667bc6d3c586f7a04dfb0082333b0e50624aac71c53172" + "3.1.1": + url: "https://github.com/martinus/unordered_dense/archive/v3.1.1.tar.gz" + sha256: "634194cec08f6a41aa72ed4804719cdf8ba94f9ba8575bf7a80496a33dfbbb12" + "3.1.0": + url: "https://github.com/martinus/unordered_dense/archive/v3.1.0.tar.gz" + sha256: "adf8670bf494a84f1148687375ac568e2990167b8ced3cc1e5bacc9f6c49f272" + "3.0.2": + url: "https://github.com/martinus/unordered_dense/archive/v3.0.2.tar.gz" + sha256: "0c0b874e9682cce3c75a1152308bfbb108538aaf1e90824d7789e2b64122520b" + "2.0.1": + url: "https://github.com/martinus/unordered_dense/archive/v2.0.1.tar.gz" + sha256: "450d53bd8709f9476702a3c4975bf6e40d66059b25b125e480534228d7f5616d" + "1.4.0": + url: "https://github.com/martinus/unordered_dense/archive/v1.4.0.tar.gz" + sha256: "36b6bfe2fe2633f9d9c537b9b808b4be6b77ff51c66d370d855f477517bc3bc9" + "1.3.3": + url: "https://github.com/martinus/unordered_dense/archive/v1.3.3.tar.gz" + sha256: "621a984d7f1de156d3078ecb5e1252bcc2ebc875de6eb6b8635f6c2a0898e496" diff --git a/unordered_dense/all/conanfile.py b/unordered_dense/all/conanfile.py new file mode 100644 index 0000000..a0da7f7 --- /dev/null +++ b/unordered_dense/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class PackageConan(ConanFile): + name = "unordered_dense" + description = "A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinus/unordered_dense" + topics = ("unordered_map", "unordered_set", "hashmap", "hashset", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "11", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "ankerl"), src=os.path.join(self.source_folder, "include", "ankerl")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "unordered_dense") + self.cpp_info.set_property("cmake_target_name", "unordered_dense::unordered_dense") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "unordered_dense" + self.cpp_info.filenames["cmake_find_package_multi"] = "unordered_dense" + self.cpp_info.names["cmake_find_package"] = "unordered_dense" + self.cpp_info.names["cmake_find_package_multi"] = "unordered_dense" diff --git a/unordered_dense/all/test_package/CMakeLists.txt b/unordered_dense/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..cceeb84 --- /dev/null +++ b/unordered_dense/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(unordered_dense REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE unordered_dense::unordered_dense) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/unordered_dense/all/test_package/conanfile.py b/unordered_dense/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fb966 --- /dev/null +++ b/unordered_dense/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + 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 can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/unordered_dense/all/test_package/test_package.cpp b/unordered_dense/all/test_package/test_package.cpp new file mode 100644 index 0000000..428f955 --- /dev/null +++ b/unordered_dense/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +// sited from https://github.com/martinus/unordered_dense/blob/main/example/main.cpp +#include + +#include + +auto main() -> int { + auto map = ankerl::unordered_dense::map(); + map[123] = "hello"; + map[987] = "world!"; + + for (auto const& [key, val] : map) { + std::cout << key << " => " << val << std::endl; + } +} diff --git a/unordered_dense/config.yml b/unordered_dense/config.yml new file mode 100644 index 0000000..6d7a568 --- /dev/null +++ b/unordered_dense/config.yml @@ -0,0 +1,37 @@ +versions: + "4.8.1": + folder: all + "4.7.0": + folder: all + "4.6.0": + folder: all + "4.5.0": + folder: all + "4.4.0": + folder: all + "4.3.1": + folder: all + "4.3.0": + folder: all + "4.1.2": + folder: all + "4.1.0": + folder: all + "4.0.4": + folder: all + "4.0.1": + folder: all + "4.0.0": + folder: all + "3.1.1": + folder: all + "3.1.0": + folder: all + "3.0.2": + folder: all + "2.0.1": + folder: all + "1.4.0": + folder: all + "1.3.3": + folder: all diff --git a/vulkan-memory-allocator/all/conandata.yml b/vulkan-memory-allocator/all/conandata.yml new file mode 100644 index 0000000..6714daa --- /dev/null +++ b/vulkan-memory-allocator/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.3.0": + url: "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/refs/tags/v3.3.0.tar.gz" + sha256: "c4f6bbe6b5a45c2eb610ca9d231158e313086d5b1a40c9922cb42b597419b14e" diff --git a/vulkan-memory-allocator/all/conanfile.py b/vulkan-memory-allocator/all/conanfile.py new file mode 100644 index 0000000..c3f008d --- /dev/null +++ b/vulkan-memory-allocator/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class VulkanMemoryAllocatorConan(ConanFile): + name = "vulkan-memory-allocator" + license = "MIT" + homepage = "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator" + url = "https://github.com/conan-io/conan-center-index" + description = "Easy to integrate Vulkan memory allocation library." + topics = ("vulkan", "memory-allocator", "graphics") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "3.0.0" else "14" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("vulkan-headers/1.4.313.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "3.0.0": + include_dir = os.path.join(self.source_folder, "src") + else: + include_dir = os.path.join(self.source_folder, "include") + copy(self, "vk_mem_alloc.h", src=include_dir, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch b/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch new file mode 100644 index 0000000..0cfd3c5 --- /dev/null +++ b/vulkan-memory-allocator/all/patches/0001-fix-appleclang.patch @@ -0,0 +1,95 @@ +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -2569,6 +2569,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include + #include + #include ++#include + + #ifdef _MSC_VER + #include // For functions like __popcnt, _BitScanForward etc. +@@ -5491,6 +5492,7 @@ public: + // Posts next part of an open string. The number is converted to decimal characters. + void ContinueString(uint32_t n); + void ContinueString(uint64_t n); ++ void ContinueString_Size(size_t n); + // Posts next part of an open string. Pointer value is converted to characters + // using "%p" formatting - shown as hexadecimal number, e.g.: 000000081276Ad00 + void ContinueString_Pointer(const void* ptr); +@@ -5500,6 +5502,7 @@ public: + // Writes a number value. + void WriteNumber(uint32_t n); + void WriteNumber(uint64_t n); ++ void WriteSize(size_t n); + // Writes a boolean value - false or true. + void WriteBool(bool b); + // Writes a null value. +@@ -5524,6 +5527,11 @@ private: + VmaVector< StackItem, VmaStlAllocator > m_Stack; + bool m_InsideString; + ++ // Write size_t for less than 64bits ++ void WriteSize(size_t n, std::integral_constant) { m_SB.AddNumber(static_cast(n)); } ++ // Write size_t for 64bits ++ void WriteSize(size_t n, std::integral_constant) { m_SB.AddNumber(static_cast(n)); } ++ + void BeginValue(bool isString); + void WriteIndent(bool oneLess = false); + }; +@@ -5666,6 +5674,14 @@ void VmaJsonWriter::ContinueString(uint64_t n) + m_SB.AddNumber(n); + } + ++void VmaJsonWriter::ContinueString_Size(size_t n) ++{ ++ VMA_ASSERT(m_InsideString); ++ // Fix for AppleClang incorrect type casting ++ // TODO: Change to if constexpr when C++17 used as minimal standard ++ WriteSize(n, std::is_same{}); ++} ++ + void VmaJsonWriter::ContinueString_Pointer(const void* ptr) + { + VMA_ASSERT(m_InsideString); +@@ -5697,6 +5713,15 @@ void VmaJsonWriter::WriteNumber(uint64_t n) + m_SB.AddNumber(n); + } + ++void VmaJsonWriter::WriteSize(size_t n) ++{ ++ VMA_ASSERT(!m_InsideString); ++ BeginValue(false); ++ // Fix for AppleClang incorrect type casting ++ // TODO: Change to if constexpr when C++17 used as minimal standard ++ WriteSize(n, std::is_same{}); ++} ++ + void VmaJsonWriter::WriteBool(bool b) + { + VMA_ASSERT(!m_InsideString); +@@ -6440,13 +6465,13 @@ void VmaBlockMetadata::PrintDetailedMap_Begin(class VmaJsonWriter& json, + json.WriteNumber(GetSize()); + + json.WriteString("UnusedBytes"); +- json.WriteNumber(unusedBytes); ++ json.WriteSize(unusedBytes); + + json.WriteString("Allocations"); +- json.WriteNumber(allocationCount); ++ json.WriteSize(allocationCount); + + json.WriteString("UnusedRanges"); +- json.WriteNumber(unusedRangeCount); ++ json.WriteSize(unusedRangeCount); + + json.WriteString("Suballocations"); + json.BeginArray(); +@@ -15964,7 +15989,7 @@ void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json) + { + json.WriteString("Name"); + json.BeginString(); +- json.ContinueString(index++); ++ json.ContinueString_Size(index++); + if (pool->GetName()) + { + json.WriteString(" - "); diff --git a/vulkan-memory-allocator/all/patches/2.3.0-add-missing-cstdio.patch b/vulkan-memory-allocator/all/patches/2.3.0-add-missing-cstdio.patch new file mode 100644 index 0000000..ef7fe08 --- /dev/null +++ b/vulkan-memory-allocator/all/patches/2.3.0-add-missing-cstdio.patch @@ -0,0 +1,15 @@ +diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h +index 32258b4..8da6bba 100644 +--- a/src/vk_mem_alloc.h ++++ b/src/vk_mem_alloc.h +@@ -3470,6 +3470,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage( + #include + #include + ++#if VMA_STATS_STRING_ENABLED ++ #include // For snprintf ++#endif ++ + /******************************************************************************* + CONFIGURATION SECTION + diff --git a/vulkan-memory-allocator/all/patches/3.0.0-add-missing-cstdio.patch b/vulkan-memory-allocator/all/patches/3.0.0-add-missing-cstdio.patch new file mode 100644 index 0000000..2852a9b --- /dev/null +++ b/vulkan-memory-allocator/all/patches/3.0.0-add-missing-cstdio.patch @@ -0,0 +1,15 @@ +diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h +index 3b395a7..542191c 100644 +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -2575,6 +2575,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include // For functions like __popcnt, _BitScanForward etc. + #endif + ++#if VMA_STATS_STRING_ENABLED ++ #include // For snprintf ++#endif ++ + /******************************************************************************* + CONFIGURATION SECTION + diff --git a/vulkan-memory-allocator/all/patches/3.0.1-add-missing-cstdio.patch b/vulkan-memory-allocator/all/patches/3.0.1-add-missing-cstdio.patch new file mode 100644 index 0000000..bab772d --- /dev/null +++ b/vulkan-memory-allocator/all/patches/3.0.1-add-missing-cstdio.patch @@ -0,0 +1,15 @@ +diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h +index 60f5720..31164bc 100644 +--- a/include/vk_mem_alloc.h ++++ b/include/vk_mem_alloc.h +@@ -2578,6 +2578,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include // For std::popcount + #endif + ++#if VMA_STATS_STRING_ENABLED ++ #include // For snprintf ++#endif ++ + /******************************************************************************* + CONFIGURATION SECTION + diff --git a/vulkan-memory-allocator/all/test_package/CMakeLists.txt b/vulkan-memory-allocator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..d26eb19 --- /dev/null +++ b/vulkan-memory-allocator/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vulkan-memory-allocator REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-memory-allocator::vulkan-memory-allocator) +if(vulkan-memory-allocator_VERSION VERSION_LESS "3.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/vulkan-memory-allocator/all/test_package/conanfile.py b/vulkan-memory-allocator/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/vulkan-memory-allocator/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "CMakeToolchain", "CMakeDeps", "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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/vulkan-memory-allocator/all/test_package/test_package.cpp b/vulkan-memory-allocator/all/test_package/test_package.cpp new file mode 100644 index 0000000..6bb4b6f --- /dev/null +++ b/vulkan-memory-allocator/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#define VMA_STATIC_VULKAN_FUNCTIONS 0 +#define VMA_IMPLEMENTATION +#include + +int main() +{ + // Load function pointers... + // vmaVmaVulkanFunctions vulkanFunctions{}; + // vulkavulkanFunctions.vkAllocateMemory = ... ; + // ... + + VmaAllocatorCreateInfo allocatorInfo{}; (void)allocatorInfo; + // allocatorInfo.instance = instance; + // allocatorInfo.physicalDevice = physicalDevice; + // allocatorInfo.device = device; + // allocatorInfo.pVulkanFunctions = &vulkanFunctions; + + VmaAllocator allocator; (void)allocator; + // vmaCreateAllocator(&allocatorInfo, &allocator); +} diff --git a/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt b/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/vulkan-memory-allocator/all/test_v1_package/conanfile.py b/vulkan-memory-allocator/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/vulkan-memory-allocator/all/test_v1_package/conanfile.py @@ -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) diff --git a/vulkan-memory-allocator/config.yml b/vulkan-memory-allocator/config.yml new file mode 100644 index 0000000..37e25f6 --- /dev/null +++ b/vulkan-memory-allocator/config.yml @@ -0,0 +1,3 @@ +versions: + "3.3.0": + folder: all diff --git a/vulkan-utility-libraries/all/conandata.yml b/vulkan-utility-libraries/all/conandata.yml new file mode 100644 index 0000000..50296dd --- /dev/null +++ b/vulkan-utility-libraries/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.313.0": + url: "https://github.com/KhronosGroup/Vulkan-Utility-Libraries/archive/refs/heads/vulkan-sdk-1.4.313.tar.gz" + sha256: "18c49c694f6b6aec17d9e8c7807a89ac7ad93517c93cb94ceaed3150bd4117ef" diff --git a/vulkan-utility-libraries/all/conanfile.py b/vulkan-utility-libraries/all/conanfile.py new file mode 100644 index 0000000..772bd9c --- /dev/null +++ b/vulkan-utility-libraries/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +import os + + +required_conan_version = ">=2.0.9" + + +class VulkanUtilityLibraries(ConanFile): + name = "vulkan-utility-libraries" + description = "Code shared across various Vulkan repositories, for Vulkan SDK developers and users." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/KhronosGroup/Vulkan-Utility-Libraries" + topics = ("vulkan") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires(f"vulkan-headers/{self.version}", transitive_headers=True) + + def validate(self): + check_min_cppstd(self, 17) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.22.1]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + license_folder = os.path.join(self.package_folder, "licenses") + copy(self, "LICENSE.md", self.source_folder, license_folder) + copy(self, "LICENSES/*", self.source_folder, license_folder, keep_path=False) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "VulkanUtilityLibraries") + for component in ["SafeStruct", "LayerSettings", "UtilityHeaders"]: + self.cpp_info.components[component].set_property("cmake_target_name", f"Vulkan::{component}") + self.cpp_info.components[component].requires = ["vulkan-headers::vulkanheaders"] + if component != "UtilityHeaders": + self.cpp_info.components[component].libs = [f"Vulkan{component}"] + else: + self.cpp_info.components[component].libdirs = [] + self.cpp_info.components[component].bindirs = [] \ No newline at end of file diff --git a/vulkan-utility-libraries/all/test_package/CMakeLists.txt b/vulkan-utility-libraries/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..9619b1c --- /dev/null +++ b/vulkan-utility-libraries/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(VulkanUtilityLibraries REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::LayerSettings Vulkan::SafeStruct Vulkan::UtilityHeaders) \ No newline at end of file diff --git a/vulkan-utility-libraries/all/test_package/conanfile.py b/vulkan-utility-libraries/all/test_package/conanfile.py new file mode 100644 index 0000000..4a9cdc0 --- /dev/null +++ b/vulkan-utility-libraries/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") \ No newline at end of file diff --git a/vulkan-utility-libraries/all/test_package/test_package.cpp b/vulkan-utility-libraries/all/test_package/test_package.cpp new file mode 100644 index 0000000..6052822 --- /dev/null +++ b/vulkan-utility-libraries/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include +#include + + +int main() { + vku::safe_VkInstanceCreateInfo safe_info; + VkApplicationInfo app = vku::InitStructHelper(); + app.pApplicationName = "test"; + app.applicationVersion = 42; + + VkDebugUtilsMessengerCreateInfoEXT debug_ci = vku::InitStructHelper(); + debug_ci.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + + VkInstanceCreateInfo info = vku::InitStructHelper(); + info.pApplicationInfo = &app; + info.pNext = &debug_ci; + + safe_info.initialize(&info); + + VkuLayerSettingSet layerSettingSet = VK_NULL_HANDLE; + vkuCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + + return 0; +} \ No newline at end of file diff --git a/vulkan-utility-libraries/config.yml b/vulkan-utility-libraries/config.yml new file mode 100644 index 0000000..3c9c208 --- /dev/null +++ b/vulkan-utility-libraries/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.313.0": + folder: all diff --git a/vulkan-validationlayers/all/conandata.yml b/vulkan-validationlayers/all/conandata.yml new file mode 100644 index 0000000..c0f92e8 --- /dev/null +++ b/vulkan-validationlayers/all/conandata.yml @@ -0,0 +1,57 @@ +sources: + "1.4.313.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/vulkan-sdk-1.4.313.0.tar.gz" + sha256: "49b8ee6c2352157b12b1c87eb1165bc0f82a885bc2135ad97041ac84f79aacd0" + "1.3.243.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "fd9f6c24027de177b2fb0eb6385542d62f4c21665a8d4cc7e1c118688e0836de" + "1.3.239.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "7aa7fb46e25e5ef0144d29c92122b631dc7c7c6804a6339f195b368ad53328e4" + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "68f2cf70b1960f85e931ef56935e6ceda1beeb214f8fa319e6b95128b02b485a" + "1.3.231.1": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.231.1.tar.gz" + sha256: "ea40af0f499e7e97a86ee54410c5c78e7f7bac40f65ae09a1549773b6501bf4d" + "1.3.224.1": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "49c00e0119e3bc11e13c0c740e57c76b582b14f754f3779b85508c4d90d9df85" + "1.3.216.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.216.0.tar.gz" + sha256: "593d9b818d536490b70322a01b306ec165df5e7a70d770d05014fbd0b325fa15" + "1.3.211.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.211.0.tar.gz" + sha256: "927c1cb98c81fe8a1a529cf2d977d701dcda49c495a19583dc00e178b6757203" +patches: + "1.3.243.0": + - patch_file: "patches/1.3.243.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.239.0": + - patch_file: "patches/1.3.239.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.231.1": + - patch_file: "patches/1.3.231.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + - patch_file: "patches/1.3.231.1-0002-cmake-no-werror.patch" + patch_description: "Allow to disable Werror for old gcc/clang versions" + patch_type: "portability" + "1.3.224.1": + - patch_file: "patches/1.3.224.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.216.0": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.211.0": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" diff --git a/vulkan-validationlayers/all/conanfile.py b/vulkan-validationlayers/all/conanfile.py new file mode 100644 index 0000000..6dc2159 --- /dev/null +++ b/vulkan-validationlayers/all/conanfile.py @@ -0,0 +1,270 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import functools +import glob +import os +import shutil +import yaml + +required_conan_version = ">=1.55.0" + + +class VulkanValidationLayersConan(ConanFile): + name = "vulkan-validationlayers" + description = "Khronos official Vulkan validation layers for Windows, Linux, Android, and MacOS." + license = "Apache-2.0" + topics = ("vulkan", "validation-layers") + homepage = "https://github.com/KhronosGroup/Vulkan-ValidationLayers" + url = "https://github.com/conan-io/conan-center-index" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_wsi_xcb": [True, False], + "with_wsi_xlib": [True, False], + "with_wsi_wayland": [True, False], + } + default_options = { + "fPIC": True, + "with_wsi_xcb": True, + "with_wsi_xlib": True, + "with_wsi_wayland": True, + } + + short_paths = True + + @property + def _dependencies_filename(self): + return f"dependencies-{self.version}.yml" + + @property + @functools.lru_cache(1) + def _dependencies_versions(self): + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependencies_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException(f"Cannot find {dependencies_filepath}") + cached_dependencies = yaml.safe_load(open(dependencies_filepath)) + return cached_dependencies + + @property + def _needs_wayland_for_build(self): + return (self.options.get_safe("with_wsi_wayland") and + (Version(self.version) < "1.3.231" or Version(self.version) >= "1.3.243.0")) + + @property + def _needs_pkg_config(self): + return self.options.get_safe("with_wsi_xcb") or \ + self.options.get_safe("with_wsi_xlib") or \ + self._needs_wayland_for_build + + @property + def _min_cppstd(self): + if Version(self.version) >= "1.3.235": + return "17" + return "11" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "apple-clang": "9", + "clang": "6", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15.7", + }, + }.get(self._min_cppstd, {}) + + def export(self): + copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_wsi_xcb + del self.options.with_wsi_xlib + del self.options.with_wsi_wayland + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("robin-hood-hashing/3.11.5") + self.requires(self._require("spirv-headers")) + if Version(conan_version).minor >= "1.4.313": + self.requires(self._require("vulkan-utility-libraries"), transitive_headers=True) + if Version(conan_version).major < "2": + # TODO: set private=True, once the issue is resolved https://github.com/conan-io/conan/issues/9390 + self.requires(self._require("spirv-tools"), private=not hasattr(self, "settings_build")) + else: + self.requires(self._require("spirv-tools")) + self.requires(self._require("vulkan-headers"), transitive_headers=True) + if self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib"): + self.requires("xorg/system") + if self._needs_wayland_for_build: + self.requires("wayland/1.22.0") + + def _require(self, recipe_name): + if recipe_name not in self._dependencies_versions: + raise ConanException(f"{recipe_name} is missing in {self._dependencies_filename}") + return f"{recipe_name}/{self._dependencies_versions[recipe_name]}" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if self.dependencies["spirv-tools"].options.shared: + raise ConanInvalidConfiguration("vulkan-validationlayers can't depend on shared spirv-tools") + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("gcc < 5 is not supported") + + def build_requirements(self): + if self._needs_pkg_config and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") + if Version(self.version) >= "1.3.239": + self.tool_requires("cmake/[>=3.17.2 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + if Version(self.version) >= "1.3.239": + tc.cache_variables["VVL_CLANG_TIDY"] = False + if Version(self.version) < "1.3.234": + tc.variables["VULKAN_HEADERS_INSTALL_DIR"] = self.dependencies["vulkan-headers"].package_folder.replace("\\", "/") + tc.variables["USE_CCACHE"] = False + if self.settings.os in ["Linux", "FreeBSD"]: + tc.variables["BUILD_WSI_XCB_SUPPORT"] = self.options.get_safe("with_wsi_xcb") + tc.variables["BUILD_WSI_XLIB_SUPPORT"] = self.options.get_safe("with_wsi_xlib") + tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = self.options.get_safe("with_wsi_wayland") + elif self.settings.os == "Android": + tc.variables["BUILD_WSI_XCB_SUPPORT"] = False + tc.variables["BUILD_WSI_XLIB_SUPPORT"] = False + tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = False + tc.variables["BUILD_WERROR"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["INSTALL_TESTS"] = False + tc.variables["BUILD_LAYERS"] = True + tc.variables["BUILD_LAYER_SUPPORT_FILES"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if self._needs_pkg_config: + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Vulkan-ValidationLayers relies on Vulkan-Headers version from CMake config file + # to set api_version in its manifest file, but this value MUST have format x.y.z (no extra number). + # FIXME: find a way to force correct version in CMakeDeps of vulkan-headers recipe? + # NOTE: At version 1.3.239, the JSON_API_VERSION was removed from the cmakelists file, + if Version(self.version) >= "1.3.235" and Version(self.version) < "1.3.239": + vk_version = Version(self.dependencies["vulkan-headers"].ref.version) + sanitized_vk_version = f"{vk_version.major}.{vk_version.minor}.{vk_version.patch}" + replace_in_file( + self, os.path.join(self.source_folder, "layers", "CMakeLists.txt"), + "set(JSON_API_VERSION ${VulkanHeaders_VERSION})", + f"set(JSON_API_VERSION \"{sanitized_vk_version}\")", + ) + # FIXME: two CMake module/config files should be generated (SPIRV-ToolsConfig.cmake and SPIRV-Tools-optConfig.cmake), + # but it can't be modeled right now in spirv-tools recipe + if not os.path.exists(os.path.join(self.generators_folder, "SPIRV-Tools-optConfig.cmake")): + shutil.copy( + os.path.join(self.generators_folder, "SPIRV-ToolsConfig.cmake"), + os.path.join(self.generators_folder, "SPIRV-Tools-optConfig.cmake"), + ) + if self.settings.os == "Android": + # INFO: libVkLayer_utils.a: error: undefined symbol: __android_log_print + # https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/a26638ae9fdd8c40b56d4c7b72859a5b9a0952c9 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "VkLayer_utils PUBLIC Vulkan::Headers", "VkLayer_utils PUBLIC Vulkan::Headers -landroid -llog") + if not self.options.get_safe("fPIC"): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "CMAKE_POSITION_INDEPENDENT_CODE ON", "CMAKE_POSITION_INDEPENDENT_CODE OFF") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.settings.os == "Windows": + # import lib is useless, validation layers are loaded at runtime + lib_dir = os.path.join(self.package_folder, "lib") + rm(self, "VkLayer_khronos_validation.lib", lib_dir) + rm(self, "libVkLayer_khronos_validation.dll.a", lib_dir) + # move dll and json manifest files in bin folder + bin_dir = os.path.join(self.package_folder, "bin") + mkdir(self, bin_dir) + for ext in ("*.dll", "*.json"): + for bin_file in glob.glob(os.path.join(lib_dir, ext)): + shutil.move(bin_file, os.path.join(bin_dir, os.path.basename(bin_file))) + else: + # Move json files to res, but keep in mind to preserve relative + # path between module library and manifest json file + rename(self, os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res")) + fix_apple_shared_install_name(self) + + def package_info(self): + if Version(conan_version).minor < "1.4.313.0": + self.cpp_info.libs = ["VkLayer_utils"] + + if Version(conan_version).minor >= "1.4.313.0": + self.cpp_info.includedirs = [] + + manifest_subfolder = "bin" if self.settings.os == "Windows" else os.path.join("res", "vulkan", "explicit_layer.d") + vk_layer_path = os.path.join(self.package_folder, manifest_subfolder) + self.runenv_info.prepend_path("VK_LAYER_PATH", vk_layer_path) + + # Update runtime discovery paths to allow libVkLayer_khronos_validation.{so,dll,dylib} to be discovered + # and loaded by vulkan-loader when the consumer executes + # This is necessary because this package exports a static lib to link against and a dynamic lib to load at runtime + runtime_lib_discovery_path = "LD_LIBRARY_PATH" + if self.settings.os == "Windows": + runtime_lib_discovery_path = "PATH" + if self.settings.os == "Macos": + runtime_lib_discovery_path = "DYLD_LIBRARY_PATH" + for libdir in [os.path.join(self.package_folder, libdir) for libdir in self.cpp_info.libdirs]: + self.runenv_info.prepend_path(runtime_lib_discovery_path, libdir) + + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.VK_LAYER_PATH.append(vk_layer_path) + + if self.settings.os == "Android": + self.cpp_info.system_libs.extend(["android", "log"]) diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml new file mode 100644 index 0000000..d6b212b --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.211.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.211.0" +spirv-tools: "1.3.211.0" +vulkan-headers: "1.3.211.0" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml new file mode 100644 index 0000000..3ca4dda --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.216.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.216.0" +spirv-tools: "1.3.216.0" +vulkan-headers: "1.3.216.0" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml new file mode 100644 index 0000000..5db991b --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.224.0" +spirv-tools: "1.3.224.0" +vulkan-headers: "1.3.224.0" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml new file mode 100644 index 0000000..55064d8 --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.231.1.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.231.1" +spirv-tools: "1.3.231.1" +vulkan-headers: "1.3.231.1" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml new file mode 100644 index 0000000..6e9ed40 --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.236.0" +spirv-tools: "1.3.236.0" +vulkan-headers: "1.3.236.0" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml new file mode 100644 index 0000000..a580c69 --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.239.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.239.0" +spirv-tools: "1.3.239.0" +vulkan-headers: "1.3.239.0" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.3.243.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.3.243.0.yml new file mode 100644 index 0000000..a8eac7c --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.3.243.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.243.0" +spirv-tools: "1.3.243.0" +vulkan-headers: "1.3.243.0" diff --git a/vulkan-validationlayers/all/dependencies/dependencies-1.4.313.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.4.313.0.yml new file mode 100644 index 0000000..4605ec0 --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.4.313.0.yml @@ -0,0 +1,4 @@ +spirv-headers: "1.4.313.0" +spirv-tools: "1.4.313.0" +vulkan-headers: "1.4.313.0" +vulkan-utility-libraries: "1.4.313.0" diff --git a/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch b/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch new file mode 100644 index 0000000..319efad --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -174,7 +174,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, diff --git a/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch b/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch new file mode 100644 index 0000000..76ce4f2 --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -174,7 +174,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -63,7 +63,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_DEFAULT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + else() diff --git a/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch b/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch new file mode 100644 index 0000000..dc72860 --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -103,7 +103,7 @@ if (GOOGLETEST_INSTALL_DIR) + list(APPEND CMAKE_PREFIX_PATH ${GOOGLETEST_INSTALL_DIR}) + endif() + +-find_package(VulkanHeaders REQUIRED) ++find_package(VulkanHeaders REQUIRED MODULE) + add_library(Vulkan-Headers INTERFACE) + target_include_directories(Vulkan-Headers INTERFACE ${VulkanHeaders_INCLUDE_DIRS}) + add_library(Vulkan::Headers ALIAS Vulkan-Headers) +@@ -229,7 +229,6 @@ if(BUILD_LAYERS OR BUILD_TESTS) + endif() + + # VVLGenerateSourceCode depends on spirv/unified1 +- include(VVLGenerateSourceCode) + + if (NOT TARGET SPIRV-Tools-opt) + find_package(SPIRV-Tools-opt REQUIRED CONFIG) +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -63,7 +63,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_DEFAULT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + else() diff --git a/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch b/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch new file mode 100644 index 0000000..5d410a8 --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,9 +171,7 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)") + -fno-builtin-memcmp) + + # Treat warnings as errors for versions of GCC and c++11-compliant Clang versions that are shipped on Ubuntu 18.04 or older. +- if(BUILD_WERROR OR +- (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 7.3.0) OR +- (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0.0)) ++ if(BUILD_WERROR) + add_compile_options(-Werror) + endif() + diff --git a/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch b/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch new file mode 100644 index 0000000..f63003f --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -230,7 +230,6 @@ endif() + if(BUILD_LAYERS OR BUILD_TESTS) + find_package(SPIRV-Headers REQUIRED CONFIG QUIET) + +- include(VVLGenerateSourceCode) + + find_package(SPIRV-Tools-opt REQUIRED CONFIG QUIET) + diff --git a/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch b/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch new file mode 100644 index 0000000..e30c2cb --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.239.0-0001-fix-cmake.patch @@ -0,0 +1,11 @@ +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -134,7 +134,7 @@ endif() + + find_package(PythonInterp 3 QUIET) + +-if (PYTHONINTERP_FOUND) ++if (0) + # Get the include directory of the SPIRV-Headers + get_target_property(SPIRV_HEADERS_INCLUDE_DIR SPIRV-Headers::SPIRV-Headers INTERFACE_INCLUDE_DIRECTORIES) + diff --git a/vulkan-validationlayers/all/patches/1.3.243.0-0001-fix-cmake.patch b/vulkan-validationlayers/all/patches/1.3.243.0-0001-fix-cmake.patch new file mode 100644 index 0000000..82517d1 --- /dev/null +++ b/vulkan-validationlayers/all/patches/1.3.243.0-0001-fix-cmake.patch @@ -0,0 +1,11 @@ +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -115,7 +115,7 @@ endif() + + find_package(PythonInterp 3 QUIET) + +-if (PYTHONINTERP_FOUND) ++if (0) + # Get the include directory of the SPIRV-Headers + get_target_property(SPIRV_HEADERS_INCLUDE_DIR SPIRV-Headers::SPIRV-Headers INTERFACE_INCLUDE_DIRECTORIES) + diff --git a/vulkan-validationlayers/all/test_package/CMakeLists.txt b/vulkan-validationlayers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..f968d5c --- /dev/null +++ b/vulkan-validationlayers/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(vulkan-validationlayers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-validationlayers::vulkan-validationlayers) +if(vulkan-validationlayers_VERSION VERSION_GREATER_EQUAL "1.3.235") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/vulkan-validationlayers/all/test_package/conanfile.py b/vulkan-validationlayers/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/vulkan-validationlayers/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "CMakeToolchain", "CMakeDeps", "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() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/vulkan-validationlayers/all/test_package/test_package.cpp b/vulkan-validationlayers/all/test_package/test_package.cpp new file mode 100644 index 0000000..51dff36 --- /dev/null +++ b/vulkan-validationlayers/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + std::cout << "VK_FORMAT_D16_UNORM " << (vkuFormatIsDepthOnly(VK_FORMAT_D16_UNORM) ? "is" : "is not") << " depth only" << std::endl; + return 0; +} diff --git a/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt b/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/vulkan-validationlayers/all/test_v1_package/conanfile.py b/vulkan-validationlayers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/vulkan-validationlayers/all/test_v1_package/conanfile.py @@ -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) diff --git a/vulkan-validationlayers/config.yml b/vulkan-validationlayers/config.yml new file mode 100644 index 0000000..1d98a4b --- /dev/null +++ b/vulkan-validationlayers/config.yml @@ -0,0 +1,17 @@ +versions: + "1.4.313.0": + folder: all + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.3.231.1": + folder: all + "1.3.224.1": + folder: all + "1.3.216.0": + folder: all + "1.3.211.0": + folder: all