commit 02d1a0a13a5d8b29aee707260205ae481306c18f Author: Romain BOULLARD Date: Mon Aug 17 01:07:23 2026 +0200 Inital commit diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..0a60a38 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,242 @@ +name: Conan Packaging + +on: + push: + branches: + - '**' + workflow_dispatch: + +env: + CCACHE_DIR: /ccache + CCACHE_MAXSIZE: 10G + CCACHE_BASEDIR: /root/.conan2 + CCACHE_COMPILERCHECK: "%compiler% -dumpversion" + +jobs: + conan-packages-tier1: + runs-on: ubuntu-latest + timeout-minutes: 120 + container: + image: git.romainboullard.com/bigfootdev/linuxcppbuilder:main + env: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + strategy: + matrix: + package: [ + { name: "mold", version: "2.41.0", location: "all" }, + + { name: "eabase", version: "01082025", location: "all" }, + + { name: "vulkan-headers", version: "1.4.341.0", location: "all" }, + { name: "spirv-headers", version: "1.4.341.0", location: "all" }, + { name: "spirv-cross", version: "1.4.341.0", location: "all" }, + + { name: "pixelmatch-cpp17", version: "1.0.3", location: "all" }, + { name: "lodepng", version: "cci.20260210", location: "all" }, + { name: "stduuid", version: "1.2.3", location: "all" }, + { name: "flatbuffers", version: "25.12.19-2026-02-06-03fffb2-bigfoot", location: "all" }, + + { name: "glm", version: "1.0.3", location: "all" }, + + { name: "unordered_dense", version: "4.8.1", location: "all" }, + { name: "mimalloc", version: "3.3.2", location: "all" }, + { name: "meshoptimizer", version: "1.2", location: "all" }, + { name: "sqlite3", version: "3.53.3", location: "all" }, + { name: "rapidhash", version: "3.0", location: "all" }, + { name: "cli11", version: "2.6.2", location: "all" }, + { name: "assimp", version: "6.0.5", location: "5.x" }, + + { name: "imgui", version: "1.92.8-docking", location: "all" }, + ] + name: "Package ${{matrix.package.name }}/${{ matrix.package.version }}" + steps: + - name: Set BRANCH_NAME + run: echo "BRANCH_NAME=$(echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Install Node.js + run: apt-get update && apt-get install -y nodejs + + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Reset ccache stats + run: ccache --zero-stats + + - name: Run Conan packaging + run: | + echo "Building ${{ matrix.package.name }}@${{ matrix.package.version }}" + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan create ./${{ matrix.package.name }}/${{ matrix.package.location }} \ + --version=${{ matrix.package.version }} \ + --user=bigfootdev \ + --channel=${{ env.BRANCH_NAME }} \ + -pr:b=./ConanProfiles/clang -pr:h=./ConanProfiles/clang \ + --build=* --remote=bigfootpackages + + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \ + --only-recipe --remote=bigfootpackages + + - name: Show ccache stats + run: ccache --show-stats + + conan-packages-tier2: + needs: conan-packages-tier1 + runs-on: ubuntu-latest + timeout-minutes: 120 + container: + image: git.romainboullard.com/bigfootdev/linuxcppbuilder:main + env: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + strategy: + matrix: + package: [ + { name: "eastl", version: "3.27.01", location: "all", needs_pkg: "eabase" }, + + { name: "vulkan-utility-libraries", version: "1.4.341.0", location: "all" }, + { name: "spirv-tools", version: "1.4.341.0", location: "all" }, + + { name: "vulkan-memory-allocator", version: "3.3.0", location: "all" }, + ] + name: "Package ${{matrix.package.name }}/${{ matrix.package.version }}" + steps: + - name: Set BRANCH_NAME + run: echo "BRANCH_NAME=$(echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Install Node.js + run: apt-get update && apt-get install -y nodejs + + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Reset ccache stats + run: ccache --zero-stats + + - name: Run Conan packaging + run: | + echo "Building ${{ matrix.package.name }}@${{ matrix.package.version }}" + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan create ./${{ matrix.package.name }}/${{ matrix.package.location }} \ + --version=${{ matrix.package.version }} \ + --user=bigfootdev \ + --channel=${{ env.BRANCH_NAME }} \ + -pr:b=./ConanProfiles/clang -pr:h=./ConanProfiles/clang \ + --build=* --remote=bigfootpackages + + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \ + --only-recipe --remote=bigfootpackages + + - name: Show ccache stats + run: ccache --show-stats + + conan-packages-tier3: + needs: conan-packages-tier2 + runs-on: ubuntu-latest + timeout-minutes: 120 + container: + image: git.romainboullard.com/bigfootdev/linuxcppbuilder:main + env: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + strategy: + matrix: + package: [ + { name: "glslang", version: "1.4.341.0", location: "all" }, + { name: "vulkan-validationlayers", version: "1.4.341.0", location: "all" }, + ] + name: "Package ${{matrix.package.name }}/${{ matrix.package.version }}" + steps: + - name: Set BRANCH_NAME + run: echo "BRANCH_NAME=$(echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Install Node.js + run: apt-get update && apt-get install -y nodejs + + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Reset ccache stats + run: ccache --zero-stats + + - name: Run Conan packaging + run: | + echo "Building ${{ matrix.package.name }}@${{ matrix.package.version }}" + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan create ./${{ matrix.package.name }}/${{ matrix.package.location }} \ + --version=${{ matrix.package.version }} \ + --user=bigfootdev \ + --channel=${{ env.BRANCH_NAME }} \ + -pr:b=./ConanProfiles/clang -pr:h=./ConanProfiles/clang \ + --build=* --remote=bigfootpackages + + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \ + --only-recipe --remote=bigfootpackages + + - name: Show ccache stats + run: ccache --show-stats + + conan-packages-tier4: + needs: conan-packages-tier3 + runs-on: ubuntu-latest + timeout-minutes: 120 + container: + image: git.romainboullard.com/bigfootdev/linuxcppbuilder:main + env: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + strategy: + matrix: + package: [ + { name: "shaderc", version: "2026.1", location: "all" }, + ] + name: "Package ${{matrix.package.name }}/${{ matrix.package.version }}" + steps: + - name: Set BRANCH_NAME + run: echo "BRANCH_NAME=$(echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Install Node.js + run: apt-get update && apt-get install -y nodejs + + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Reset ccache stats + run: ccache --zero-stats + + - name: Run Conan packaging + run: | + echo "Building ${{ matrix.package.name }}@${{ matrix.package.version }}" + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan create ./${{ matrix.package.name }}/${{ matrix.package.location }} \ + --version=${{ matrix.package.version }} \ + --user=bigfootdev \ + --channel=${{ env.BRANCH_NAME }} \ + -pr:b=./ConanProfiles/clang -pr:h=./ConanProfiles/clang \ + --build=* --remote=bigfootpackages + + CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \ + CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \ + conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \ + --only-recipe --remote=bigfootpackages + + - name: Show ccache stats + run: ccache --show-stats \ No newline at end of file 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/ConanProfiles/Toolchains/ccache.cmake b/ConanProfiles/Toolchains/ccache.cmake new file mode 100644 index 0000000..5fce6ee --- /dev/null +++ b/ConanProfiles/Toolchains/ccache.cmake @@ -0,0 +1,30 @@ +include_guard() + +# Find ccache executable +find_program(CCACHE_PROGRAM NAMES ccache) + +if(CCACHE_PROGRAM) + message(STATUS "ccache found: ${CCACHE_PROGRAM}, enabling via CMake launcher and environment.") + if (CMAKE_GENERATOR MATCHES "Visual Studio") + # Copy original ccache.exe and rename to cl.exe, this way intermediate cmd file is not needed + file(COPY_FILE ${CCACHE_PROGRAM} ${CMAKE_BINARY_DIR}/cl.exe ONLY_IF_DIFFERENT) + + # Set Visual Studio global variables: + # - Use above cl.exe (ccache.exe) as a compiler + # - Enable parallel compilation + list(APPEND CMAKE_VS_GLOBALS + "CLToolExe=cl.exe" + "CLToolPath=${CMAKE_BINARY_DIR}" + "UseMultiToolTask=true" + "UseStructuredOutput=false" + ) + elseif(CMAKE_GENERATOR MATCHES "Ninja" OR CMAKE_GENERATOR MATCHES "Unix Makefiles") + message(STATUS "Using ccache as compiler launcher for Ninja or Makefiles.") + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "CXX compiler cache used" FORCE) + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "C compiler cache used" FORCE) + else() + message(WARNING "Unsupported generator for ccache integration: ${CMAKE_GENERATOR}. ccache will not be used.") + endif() +else() + message(WARNING "ccache not found. Not enabling ccache integration.") +endif() \ No newline at end of file diff --git a/ConanProfiles/Toolchains/ipo.cmake b/ConanProfiles/Toolchains/ipo.cmake new file mode 100644 index 0000000..7e83475 --- /dev/null +++ b/ConanProfiles/Toolchains/ipo.cmake @@ -0,0 +1,5 @@ +include_guard() + +set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) + +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) \ No newline at end of file diff --git a/ConanProfiles/Toolchains/ipo.ini b/ConanProfiles/Toolchains/ipo.ini new file mode 100644 index 0000000..bf155da --- /dev/null +++ b/ConanProfiles/Toolchains/ipo.ini @@ -0,0 +1,2 @@ +[built-in options] +b_lto = true \ No newline at end of file diff --git a/ConanProfiles/clang b/ConanProfiles/clang new file mode 100644 index 0000000..0dadd57 --- /dev/null +++ b/ConanProfiles/clang @@ -0,0 +1,26 @@ +[settings] +os=Linux +arch=x86_64 +compiler=clang +compiler.version=22 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +compiler.cstd=17 +compiler.runtime=static +build_type=Release + +[conf] +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake +tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini + +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=True + +tools.build:compiler_executables={"c": "clang", "cpp": "clang++"} + +[tool_requires] +!cmake/*: cmake/[>=4.2] + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file diff --git a/ConanProfiles/msvc b/ConanProfiles/msvc new file mode 100644 index 0000000..d2cc52f --- /dev/null +++ b/ConanProfiles/msvc @@ -0,0 +1,23 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=195 +compiler.cppstd=20 +compiler.cstd=17 +compiler.runtime=static +build_type=Release + +[conf] +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ccache.cmake +tools.cmake.cmaketoolchain:user_toolchain+={{profile_dir}}/Toolchains/ipo.cmake +tools.meson.mesontoolchain:extra_machine_files+={{profile_dir}}/Toolchains/ipo.ini + +tools.build:cflags=["/Zc:preprocessor", "/Zc:__STDC__", "/D_CRT_DECLARE_NONSTDC_NAMES=1"] +tools.build:cxxflags=["/Zc:preprocessor", "/permissive-", "/Zc:__cplusplus", "/Zc:enumTypes", "/Zc:templateScope"] + +[tool_requires] +!cmake/*: cmake/[>=4.2] + +[buildenv] +CCACHE_NOHASHDIR=1 \ No newline at end of file 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/assimp/5.x/conan_deps.cmake b/assimp/5.x/conan_deps.cmake new file mode 100644 index 0000000..11760a3 --- /dev/null +++ b/assimp/5.x/conan_deps.cmake @@ -0,0 +1,43 @@ +find_package(minizip REQUIRED CONFIG) +link_libraries(minizip::minizip) + +find_package(pugixml REQUIRED CONFIG) +link_libraries(pugixml::pugixml) + +find_package(utf8cpp REQUIRED CONFIG) +link_libraries(utf8cpp::utf8cpp) + +find_package(ZLIB REQUIRED CONFIG) +link_libraries(ZLIB::ZLIB) + +if(WITH_CLIPPER) + find_package(clipper REQUIRED CONFIG) + link_libraries(clipper::clipper) +endif() +if(WITH_DRACO) + find_package(draco REQUIRED CONFIG) + link_libraries(draco::draco) + add_definitions(-DASSIMP_ENABLE_DRACO) +endif() +if(WITH_KUBAZIP) + find_package(zip REQUIRED CONFIG) + link_libraries(zip::zip) +endif() +if(WITH_OPENDDL) + find_package(openddlparser REQUIRED CONFIG) + link_libraries(openddlparser::openddlparser) +endif() +if(WITH_POLY2TRI) + find_package(poly2tri REQUIRED CONFIG) + link_libraries(poly2tri::poly2tri) +endif() +if(WITH_PUGIXML) +endif() +if(WITH_RAPIDJSON) + find_package(RapidJSON REQUIRED CONFIG) + link_libraries(rapidjson::rapidjson) +endif() +if(WITH_STB) + find_package(stb REQUIRED CONFIG) + link_libraries(stb::stb) +endif() diff --git a/assimp/5.x/conandata.yml b/assimp/5.x/conandata.yml new file mode 100644 index 0000000..ed4df87 --- /dev/null +++ b/assimp/5.x/conandata.yml @@ -0,0 +1,13 @@ +sources: + "6.0.5": + url: "https://github.com/assimp/assimp/archive/refs/tags/v6.0.5.tar.gz" + sha256: "edf3749559c2b7d1f758ffb66fc5bec62186221e623b7f2e8969f17ee46ecb6f" + "6.0.4": + url: "https://github.com/assimp/assimp/archive/refs/tags/v6.0.4.tar.gz" + sha256: "afa5487efdd285661afa842c85187cd8c541edad92e8d4aa85be4fca7476eccc" + "6.0.2": + url: "https://github.com/assimp/assimp/archive/refs/tags/v6.0.2.tar.gz" + sha256: "d1822d9a19c9205d6e8bc533bf897174ddb360ce504680f294170cc1d6319751" + "5.4.3": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.tar.gz" + sha256: "66dfbaee288f2bc43172440a55d0235dfc7bf885dda6435c038e8000e79582cb" diff --git a/assimp/5.x/conanfile.py b/assimp/5.x/conanfile.py new file mode 100644 index 0000000..ceba4f5 --- /dev/null +++ b/assimp/5.x/conanfile.py @@ -0,0 +1,329 @@ +from pathlib import Path + +from conan import ConanFile +from conan.tools.build import stdcpp_library, check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import collect_libs, copy, get, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=2" + + +class AssimpConan(ConanFile): + name = "assimp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/assimp/assimp" + description = ( + "A library to import and export various 3d-model-formats including " + "scene-post-processing to generate missing render data." + ) + topics = ("assimp", "3d", "game development", "3mf", "collada") + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "double_precision": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "double_precision": False, + } + + _format_option_map = { + "with_3d": ("ASSIMP_BUILD_3D_IMPORTER", "5.0.0"), + "with_3ds": ("ASSIMP_BUILD_3DS_IMPORTER", "5.0.0"), + "with_3ds_exporter": ("ASSIMP_BUILD_3DS_EXPORTER", "5.0.0"), + "with_3mf": ("ASSIMP_BUILD_3MF_IMPORTER", "5.0.0"), + "with_3mf_exporter": ("ASSIMP_BUILD_3MF_EXPORTER", "5.0.0"), + "with_ac": ("ASSIMP_BUILD_AC_IMPORTER", "5.0.0"), + "with_amf": ("ASSIMP_BUILD_AMF_IMPORTER", "5.0.0"), + "with_ase": ("ASSIMP_BUILD_ASE_IMPORTER", "5.0.0"), + "with_assbin": ("ASSIMP_BUILD_ASSBIN_IMPORTER", "5.0.0"), + "with_assbin_exporter": ("ASSIMP_BUILD_ASSBIN_EXPORTER", "5.0.0"), + "with_assxml_exporter": ("ASSIMP_BUILD_ASSXML_EXPORTER", "5.0.0"), + "with_assjson_exporter": ("ASSIMP_BUILD_ASSJSON_EXPORTER", "5.0.0"), + "with_b3d": ("ASSIMP_BUILD_B3D_IMPORTER", "5.0.0"), + "with_blend": ("ASSIMP_BUILD_BLEND_IMPORTER", "5.0.0"), + "with_bvh": ("ASSIMP_BUILD_BVH_IMPORTER", "5.0.0"), + "with_ms3d": ("ASSIMP_BUILD_MS3D_IMPORTER", "5.0.0"), + "with_cob": ("ASSIMP_BUILD_COB_IMPORTER", "5.0.0"), + "with_collada": ("ASSIMP_BUILD_COLLADA_IMPORTER", "5.0.0"), + "with_collada_exporter": ("ASSIMP_BUILD_COLLADA_EXPORTER", "5.0.0"), + "with_csm": ("ASSIMP_BUILD_CSM_IMPORTER", "5.0.0"), + "with_dxf": ("ASSIMP_BUILD_DXF_IMPORTER", "5.0.0"), + "with_fbx": ("ASSIMP_BUILD_FBX_IMPORTER", "5.0.0"), + "with_fbx_exporter": ("ASSIMP_BUILD_FBX_EXPORTER", "5.0.0"), + "with_gltf": ("ASSIMP_BUILD_GLTF_IMPORTER", "5.0.0"), + "with_gltf_exporter": ("ASSIMP_BUILD_GLTF_EXPORTER", "5.0.0"), + "with_hmp": ("ASSIMP_BUILD_HMP_IMPORTER", "5.0.0"), + "with_ifc": ("ASSIMP_BUILD_IFC_IMPORTER", "5.0.0"), + "with_irr": ("ASSIMP_BUILD_IRR_IMPORTER", "5.0.0"), + "with_irrmesh": ("ASSIMP_BUILD_IRRMESH_IMPORTER", "5.0.0"), + "with_lwo": ("ASSIMP_BUILD_LWO_IMPORTER", "5.0.0"), + "with_lws": ("ASSIMP_BUILD_LWS_IMPORTER", "5.0.0"), + "with_md2": ("ASSIMP_BUILD_MD2_IMPORTER", "5.0.0"), + "with_md3": ("ASSIMP_BUILD_MD3_IMPORTER", "5.0.0"), + "with_md5": ("ASSIMP_BUILD_MD5_IMPORTER", "5.0.0"), + "with_mdc": ("ASSIMP_BUILD_MDC_IMPORTER", "5.0.0"), + "with_mdl": ("ASSIMP_BUILD_MDL_IMPORTER", "5.0.0"), + "with_mmd": ("ASSIMP_BUILD_MMD_IMPORTER", "5.0.0"), + "with_ndo": ("ASSIMP_BUILD_NDO_IMPORTER", "5.0.0"), + "with_nff": ("ASSIMP_BUILD_NFF_IMPORTER", "5.0.0"), + "with_obj": ("ASSIMP_BUILD_OBJ_IMPORTER", "5.0.0"), + "with_obj_exporter": ("ASSIMP_BUILD_OBJ_EXPORTER", "5.0.0"), + "with_off": ("ASSIMP_BUILD_OFF_IMPORTER", "5.0.0"), + "with_ogre": ("ASSIMP_BUILD_OGRE_IMPORTER", "5.0.0"), + "with_opengex": ("ASSIMP_BUILD_OPENGEX_IMPORTER", "5.0.0"), + "with_opengex_exporter": ("ASSIMP_BUILD_OPENGEX_EXPORTER", "5.0.0"), + "with_pbrt_exporter": ("ASSIMP_BUILD_PBRT_EXPORTER", "5.1.0"), + "with_ply": ("ASSIMP_BUILD_PLY_IMPORTER", "5.0.0"), + "with_ply_exporter": ("ASSIMP_BUILD_PLY_EXPORTER", "5.0.0"), + "with_q3bsp": ("ASSIMP_BUILD_Q3BSP_IMPORTER", "5.0.0"), + "with_q3d": ("ASSIMP_BUILD_Q3D_IMPORTER", "5.0.0"), + "with_raw": ("ASSIMP_BUILD_RAW_IMPORTER", "5.0.0"), + "with_sib": ("ASSIMP_BUILD_SIB_IMPORTER", "5.0.0"), + "with_smd": ("ASSIMP_BUILD_SMD_IMPORTER", "5.0.0"), + "with_step": ("ASSIMP_BUILD_STEP_IMPORTER", "5.0.0"), + "with_step_exporter": ("ASSIMP_BUILD_STEP_EXPORTER", "5.0.0"), + "with_stl": ("ASSIMP_BUILD_STL_IMPORTER", "5.0.0"), + "with_stl_exporter": ("ASSIMP_BUILD_STL_EXPORTER", "5.0.0"), + "with_terragen": ("ASSIMP_BUILD_TERRAGEN_IMPORTER", "5.0.0"), + "with_x": ("ASSIMP_BUILD_X_IMPORTER", "5.0.0"), + "with_x_exporter": ("ASSIMP_BUILD_X_EXPORTER", "5.0.0"), + "with_x3d": ("ASSIMP_BUILD_X3D_IMPORTER", "5.0.0"), + "with_x3d_exporter": ("ASSIMP_BUILD_X3D_EXPORTER", "5.0.0"), + "with_xgl": ("ASSIMP_BUILD_XGL_IMPORTER", "5.0.0"), + "with_m3d": ("ASSIMP_BUILD_M3D_IMPORTER", "5.1.0"), + "with_m3d_exporter": ("ASSIMP_BUILD_M3D_EXPORTER", "5.1.0"), + "with_iqm": ("ASSIMP_BUILD_IQM_IMPORTER", "5.2.0"), + } + options.update(dict.fromkeys(_format_option_map, [True, False])) + default_options.update(dict.fromkeys(_format_option_map, True)) + + def export_sources(self): + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + for option, (_, min_version) in self._format_option_map.items(): + if Version(self.version) < Version(min_version): + delattr(self.options, option) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + @property + def _depends_on_kuba_zip(self): + return self.options.with_3mf_exporter + + @property + def _depends_on_poly2tri(self): + return self.options.with_blend or self.options.with_ifc + + @property + def _depends_on_rapidjson(self): + return self.options.with_gltf or self.options.with_gltf_exporter + + @property + def _depends_on_draco(self): + return self.options.with_gltf or self.options.with_gltf_exporter + + @property + def _depends_on_clipper(self): + return self.options.with_ifc + + @property + def _depends_on_stb(self): + return self.options.with_m3d or self.options.with_m3d_exporter or \ + self.options.with_pbrt_exporter + + @property + def _depends_on_openddlparser(self): + return self.options.with_opengex + + def requirements(self): + # TODO: unvendor others libs: + # - Open3DGC + self.requires("minizip/1.2.13") + self.requires("pugixml/1.14") + self.requires("utfcpp/4.0.1") + self.requires("zlib/[>=1.2.11 <2]") + if self._depends_on_kuba_zip: + self.requires("kuba-zip/0.3.0") + if self._depends_on_poly2tri: + self.requires("poly2tri/cci.20130502") + if self._depends_on_rapidjson: + self.requires("rapidjson/cci.20230929") + if self._depends_on_draco: + self.requires("draco/1.5.6") + if self._depends_on_clipper: + self.requires("clipper/6.4.2") + if self._depends_on_stb: + self.requires("stb/cci.20230920") + if self._depends_on_openddlparser: + self.requires("openddl-parser/0.5.1") + + def validate_build(self): + check_min_cppstd(self, 17) + + def validate(self): + check_min_cppstd(self, 11) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.22]") + + 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["ASSIMP_ANDROID_JNIIOSYSTEM"] = False + tc.variables["ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT"] = False + tc.variables["ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT"] = False + tc.variables["ASSIMP_BUILD_ASSIMP_TOOLS"] = False + tc.variables["ASSIMP_BUILD_DOCS"] = False + tc.variables["ASSIMP_BUILD_DRACO"] = False + tc.variables["ASSIMP_BUILD_FRAMEWORK"] = False + tc.variables["ASSIMP_BUILD_MINIZIP"] = False + tc.variables["ASSIMP_BUILD_SAMPLES"] = False + tc.variables["ASSIMP_BUILD_TESTS"] = False + tc.variables["ASSIMP_BUILD_ZLIB"] = False + tc.variables["ASSIMP_DOUBLE_PRECISION"] = self.options.double_precision + tc.variables["ASSIMP_HUNTER_ENABLED"] = False + tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True + tc.variables["ASSIMP_INJECT_DEBUG_POSTFIX"] = False + tc.variables["ASSIMP_INSTALL"] = True + tc.variables["ASSIMP_INSTALL_PDB"] = False + tc.variables["ASSIMP_NO_EXPORT"] = False + tc.variables["ASSIMP_OPT_BUILD_PACKAGES"] = False + tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False + tc.variables["ASSIMP_UBSAN"] = False + tc.variables["ASSIMP_WARNINGS_AS_ERRORS"] = False + tc.variables["USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.cache_variables["ASSIMP_BUILD_USE_CCACHE"] = False + + for option, (definition, _) in self._format_option_map.items(): + value = self.options.get_safe(option) + if value is not None: + tc.variables[definition] = value + if self.settings.os == "Windows": + tc.preprocessor_definitions["NOMINMAX"] = 1 + + tc.cache_variables["CMAKE_PROJECT_Assimp_INCLUDE"] = "conan_deps.cmake" + tc.cache_variables["WITH_CLIPPER"] = self._depends_on_clipper + tc.cache_variables["WITH_DRACO"] = self._depends_on_draco + tc.cache_variables["WITH_KUBAZIP"] = self._depends_on_kuba_zip + tc.cache_variables["WITH_OPENDDL"] = self._depends_on_openddlparser + tc.cache_variables["WITH_POLY2TRI"] = self._depends_on_poly2tri + tc.cache_variables["WITH_RAPIDJSON"] = self._depends_on_rapidjson + tc.cache_variables["WITH_STB"] = self._depends_on_stb + tc.generate() + + cd = CMakeDeps(self) + cd.set_property("rapidjson", "cmake_target_name", "rapidjson::rapidjson") + cd.set_property("utfcpp", "cmake_target_name", "utf8cpp::utf8cpp") + cd.generate() + + def _patch_sources(self): + # Don't force several compiler and linker flags + for pattern in [ + "-fPIC", + "-g ", + "SET(CMAKE_POSITION_INDEPENDENT_CODE ON)", + 'SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")', + 'SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")', + ]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "") + + for pattern in ["-Werror", "/WX"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "") + replace_in_file(self, os.path.join(self.source_folder, "code", "CMakeLists.txt"), pattern, "") + + # Make sure vendored libs are not used by accident by removing their subdirs + allow_vendored = ["Open3DGC", "earcut-hpp"] + for contrib_dir in Path(self.source_folder).joinpath("contrib").iterdir(): + if contrib_dir.is_dir() and contrib_dir.name not in allow_vendored: + rmdir(self, contrib_dir) + + # Do not include add vendored library sources to the build + # https://github.com/assimp/assimp/blob/v5.3.1/code/CMakeLists.txt#L1151-L1159 + code_cmakelists = Path(self.source_folder).joinpath("code", "CMakeLists.txt") + content = code_cmakelists.read_text(encoding="utf-8") + for vendored_lib in [ + "unzip_compile", + "Poly2Tri", + "Clipper", + "openddl_parser", + # "open3dgc", + "ziplib", + "Pugixml", + "stb", + ]: + content = content.replace("${%s_SRCS}" % vendored_lib, "") + code_cmakelists.write_text(content, encoding="utf-8") + + # Make vendored headers redirect to external ones. + for contrib_header, include in [ + (os.path.join("clipper", "clipper.hpp"), "polyclipping/clipper.hpp"), + (os.path.join("poly2tri", "poly2tri", "poly2tri.h"), "poly2tri/poly2tri.h"), + (os.path.join("stb", "stb_image.h"), "stb_image.h"), + (os.path.join("utf8cpp", "source", "utf8.h"), "utf8.h"), + (os.path.join("zip", "src", "zip.h"), "zip/zip.h"), + ]: + save(self, os.path.join(self.source_folder, "contrib", contrib_header), + f"#include <{include}>\n") + rmdir(self, os.path.join(self.source_folder, "contrib", "utf8cpp")) + + # minizip is provided via conan_deps.cmake, no need to use pkgconfig + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "use_pkgconfig(UNZIP minizip)", "set(UNZIP_FOUND TRUE)") + + # ZLIB is unvendored, no need to install it + # https://github.com/assimp/assimp/blob/v5.3.1/CMakeLists.txt#L483-L487 + # https://github.com/assimp/assimp/blob/v5.1.6/CMakeLists.txt#L463-L466 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "INSTALL( TARGETS zlib", "set(_ #") + + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "assimp") + self.cpp_info.set_property("cmake_target_name", "assimp::assimp") + self.cpp_info.set_property("pkg_config_name", "assimp") + # Always ever just 1 library, but with some suffix variations + # that make it hard to map manually + self.cpp_info.libs = collect_libs(self) + if is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("ASSIMP_DLL") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["rt", "m", "pthread"] + elif self.settings.os == "WindowsStore": + self.cpp_info.system_libs.append("advapi32") + self.cpp_info.defines.append("WindowsStore") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/assimp/5.x/test_package/CMakeLists.txt b/assimp/5.x/test_package/CMakeLists.txt new file mode 100644 index 0000000..600f67a --- /dev/null +++ b/assimp/5.x/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) + +find_package(assimp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE assimp::assimp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE assimp::assimp) diff --git a/assimp/5.x/test_package/conanfile.py b/assimp/5.x/test_package/conanfile.py new file mode 100644 index 0000000..dd82a39 --- /dev/null +++ b/assimp/5.x/test_package/conanfile.py @@ -0,0 +1,29 @@ +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") + + bin_c_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_c_path, env="conanrun") diff --git a/assimp/5.x/test_package/test_package.c b/assimp/5.x/test_package/test_package.c new file mode 100644 index 0000000..1f212b3 --- /dev/null +++ b/assimp/5.x/test_package/test_package.c @@ -0,0 +1,17 @@ +#include + +#include +#include +#include + +int main(int argc, char **argv) { + const C_STRUCT aiScene *scene = aiImportFile("", + aiProcess_CalcTangentSpace | + aiProcess_Triangulate | + aiProcess_JoinIdenticalVertices | + aiProcess_SortByPType); + + aiReleaseImport(scene); + + return 0; +} diff --git a/assimp/5.x/test_package/test_package.cpp b/assimp/5.x/test_package/test_package.cpp new file mode 100644 index 0000000..bf610dc --- /dev/null +++ b/assimp/5.x/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include +#include + +int main(int argc, char **argv) { + Assimp::Importer importer; + const aiScene* scene = importer.ReadFile("", + aiProcess_CalcTangentSpace | + aiProcess_Triangulate | + aiProcess_JoinIdenticalVertices | + aiProcess_SortByPType); + + return 0; +} diff --git a/assimp/config.yml b/assimp/config.yml new file mode 100644 index 0000000..050680a --- /dev/null +++ b/assimp/config.yml @@ -0,0 +1,9 @@ +versions: + "6.0.5": + folder: "5.x" + "6.0.4": + folder: "5.x" + "6.0.2": + folder: "5.x" + "5.4.3": + folder: "5.x" diff --git a/cli11/all/conandata.yml b/cli11/all/conandata.yml new file mode 100644 index 0000000..b1a2c97 --- /dev/null +++ b/cli11/all/conandata.yml @@ -0,0 +1,46 @@ +sources: + "2.6.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.6.2.tar.gz" + sha256: "c6ea6b2e5608b3ea8617999bd5f47420c71b2ebdb8dc4767c1034d1da5785711" + "2.6.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.6.1.tar.gz" + sha256: "377691f3fac2b340f12a2f79f523c780564578ba3d6eaf5238e9f35895d5ba95" + "2.6.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.6.0.tar.gz" + sha256: "8c11bc049090a66cb71c3e90350cddaa792b2a45e0a7841799900b95ca38b101" + "2.5.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.5.0.tar.gz" + sha256: "17e02b4cddc2fa348e5dbdbb582c59a3486fa2b2433e70a0c3bacb871334fd55" + "2.4.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.2.tar.gz" + sha256: "f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a" + "2.4.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.1.tar.gz" + sha256: "73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58" + "2.4.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.0.tar.gz" + sha256: "d2ce8d5318d2a7a7d1120e2a18caac49cd65423d5d4158cbbc0267e6768af522" + "2.3.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.2.tar.gz" + sha256: "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22" + "2.3.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.1.tar.gz" + sha256: "378da73d2d1d9a7b82ad6ed2b5bda3e7bc7093c4034a1d680a2e009eb067e7b2" + "2.3.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.0.tar.gz" + sha256: "b6e116ca1555e2b7f2743fd41e3bd18149baae791acd98eb653e5b07e0f20561" + "2.2.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.2.0.tar.gz" + sha256: "d60440dc4d43255f872d174e416705f56ba40589f6eb07727f76376fb8378fd6" + "2.1.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.1.2.tar.gz" + sha256: "26291377e892ba0e5b4972cdfd4a2ab3bf53af8dac1f4ea8fe0d1376b625c8cb" + "2.1.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.1.1.tar.gz" + sha256: "d69023d1d0ab6a22be86b4f59d449422bc5efd9121868f4e284d6042e52f682e" + "2.0.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.0.0.tar.gz" + sha256: "2c672f17bf56e8e6223a3bfb74055a946fa7b1ff376510371902adb9cb0ab6a3" + "1.9.1": + url: "https://github.com/CLIUtils/CLI11/archive/v1.9.1.tar.gz" + sha256: "c780cf8cf3ba5ec2648a7eeb20a47e274493258f38a9b417628e0576f473a50b" diff --git a/cli11/all/conanfile.py b/cli11/all/conanfile.py new file mode 100644 index 0000000..227ff90 --- /dev/null +++ b/cli11/all/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class CLI11Conan(ConanFile): + name = "cli11" + description = "A command line parser for C++11 and beyond." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CLIUtils/CLI11" + topics = "cli-parser", "cpp11", "no-dependencies", "cli" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + options = { + "header_only": [True, False] + } + default_options = { + "header_only": True + } + + @property + def _min_cppstd(self): + return "11" + + @property + def _supports_compilation(self): + return Version(self.version) >= "2.3" + + def configure(self): + if not self._supports_compilation: + # TODO: Back to config_options after Conan 1 freeze + del self.options.header_only + elif not self.options.header_only: + self.package_type = "static-library" + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + if not self._supports_compilation or self.info.options.header_only: + 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], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self._supports_compilation: + tc.variables["CLI11_PRECOMPILED"] = not self.options.header_only + tc.variables["CLI11_BUILD_EXAMPLES"] = False + tc.variables["CLI11_BUILD_TESTS"] = False + tc.variables["CLI11_BUILD_DOCS"] = False + tc.generate() + + def build(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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + # since 2.1.1 + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self._supports_compilation and not self.options.get_safe("header_only"): + self.cpp_info.libdirs = ["lib"] + self.cpp_info.libs = ["CLI11"] + self.cpp_info.defines = ["CLI11_COMPILE"] + + self.cpp_info.set_property("cmake_file_name", "CLI11") + self.cpp_info.set_property("cmake_target_name", "CLI11::CLI11") + self.cpp_info.set_property("pkg_config_name", "CLI11") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "CLI11" + self.cpp_info.names["cmake_find_package_multi"] = "CLI11" + self.cpp_info.names["pkg_config"] = "CLI11" diff --git a/cli11/all/test_package/CMakeLists.txt b/cli11/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..a5cc100 --- /dev/null +++ b/cli11/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(CLI11 REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE CLI11::CLI11) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/cli11/all/test_package/conanfile.py b/cli11/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fb966 --- /dev/null +++ b/cli11/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/cli11/all/test_package/test_package.cpp b/cli11/all/test_package/test_package.cpp new file mode 100644 index 0000000..cec812b --- /dev/null +++ b/cli11/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include + +int main(int argc, char **argv) { + CLI::App app("Test App"); + CLI11_PARSE(app, argc, argv); + + std::cout << app.help() << '\n'; + return 0; +} diff --git a/cli11/config.yml b/cli11/config.yml new file mode 100644 index 0000000..6c83541 --- /dev/null +++ b/cli11/config.yml @@ -0,0 +1,31 @@ +versions: + "2.6.2": + folder: all + "2.6.1": + folder: all + "2.6.0": + folder: all + "2.5.0": + folder: all + "2.4.2": + folder: all + "2.4.1": + folder: all + "2.4.0": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.1.2": + folder: all + "2.1.1": + folder: all + "2.0.0": + folder: all + "1.9.1": + folder: all 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..9e45435 --- /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(f"eabase/01082025@{self.user}/{self.channel}", 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..26842dd --- /dev/null +++ b/flatbuffers/all/conandata.yml @@ -0,0 +1,65 @@ +sources: + "25.12.19-2026-02-06-03fffb2-bigfoot": + url: "https://git.romainboullard.com/BigfootDev/flatbuffers-bigfoot/archive/v25.12.19-2026-02-06-03fffb2-bigfoot.tar.gz" + sha256: "6e993345f4bcb08def0e8e6a7361cdb067191736bdbfdcc77141d6eff801874c" + "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..9642d56 --- /dev/null +++ b/flatbuffers/config.yml @@ -0,0 +1,35 @@ +versions: + "25.12.19-2026-02-06-03fffb2-bigfoot": + folder: all + "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/glm/all/conandata.yml b/glm/all/conandata.yml new file mode 100644 index 0000000..6ebd105 --- /dev/null +++ b/glm/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.3": + url: "https://github.com/g-truc/glm/releases/download/1.0.3/glm-1.0.3.zip" + sha256: "1c0a0fced9b0d87c7b7bc94e40be490cff6d4c83c25db8488d8f33754e7fdeb2" + "1.0.1": + url: "https://github.com/g-truc/glm/releases/download/1.0.1/glm-1.0.1-light.zip" + sha256: "9A995DE4DA09723BD33EF194E6B79818950E5A8F2E154792F02E4615277CFB8D" + "0.9.9.8": + url: "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip" + sha256: "37e2a3d62ea3322e43593c34bae29f57e3e251ea89f4067506c94043769ade4c" diff --git a/glm/all/conanfile.py b/glm/all/conanfile.py new file mode 100644 index 0000000..f4a50d4 --- /dev/null +++ b/glm/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class GlmConan(ConanFile): + name = "glm" + description = "OpenGL Mathematics (GLM)" + topics = ("glm", "opengl", "mathematics") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/g-truc/glm" + license = "MIT" + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=self.version < Version("1.0.0")) + + def build(self): + pass + + def package(self): + if self.version < Version("1.0.0"): + copy(self, "copying.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "copying.txt", src=os.path.join(self.source_folder, "glm"), dst=os.path.join(self.package_folder, "licenses")) + + if self.version < Version("1.0.2"): + for headers in ("*.hpp", "*.inl", "*.h", "*.cppm"): + copy(self, headers, src=os.path.join(self.source_folder, "glm"), + dst=os.path.join(self.package_folder, "include", "glm")) + else: + for headers in ("*.hpp", "*.inl", "*.h", "*.cppm"): + copy(self, headers, src=os.path.join(self.source_folder, "glm"), + dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "glm") + self.cpp_info.set_property("cmake_target_name", "glm::glm") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/glm/all/test_package/CMakeLists.txt b/glm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..5de0300 --- /dev/null +++ b/glm/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(glm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glm::glm) diff --git a/glm/all/test_package/conanfile.py b/glm/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/glm/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/glm/all/test_package/test_package.cpp b/glm/all/test_package/test_package.cpp new file mode 100644 index 0000000..a2fcaaf --- /dev/null +++ b/glm/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include "glm/glm.hpp" + +int main (int argc, char * argv[]) { + glm::vec4 position = glm::vec4(glm::vec3(0.0), 1.0); + glm::mat4 model = glm::mat4(1.0); + model[3] = glm::vec4(1.0, 1.0, 0.0, 1.0); + glm::vec4 transformed = model * position; + + return EXIT_SUCCESS; +} diff --git a/glm/config.yml b/glm/config.yml new file mode 100644 index 0000000..068a6c5 --- /dev/null +++ b/glm/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.3": + folder: all + "1.0.1": + folder: all + "0.9.9.8": + folder: all diff --git a/glslang/all/CMakeLists.txt b/glslang/all/CMakeLists.txt new file mode 100644 index 0000000..a777fe2 --- /dev/null +++ b/glslang/all/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper) + +# TODO: +# - It should be find_package(SPIRV-Tools-opt REQUIRED CONFIG), but it can't be +# modeled yet in spirv-tools recipe. +# - Upstream CMakeLists is not very neat, and doesn't always link +# Spirv-Tools-opt in all required targets. Keep in mind that it works thanks +# to global injection of include dirs/interface definitions from +# conan_basic_setup(). It won't work without patches when moving to +# CMakeToolchain + CMakeDeps. +if(ENABLE_OPT) + find_package(SPIRV-Tools REQUIRED CONFIG) +endif() + +add_subdirectory(src) diff --git a/glslang/all/conandata.yml b/glslang/all/conandata.yml new file mode 100644 index 0000000..a5258cf --- /dev/null +++ b/glslang/all/conandata.yml @@ -0,0 +1,26 @@ +# Add only the SDK release versions from https://github.com/KhronosGroup/glslang/tags for consistency +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/vulkan-sdk-1.4.341.0.tar.gz" + sha256: "18cdf7d40a39001dde842c6a1338b2c9321ac5e487139b9d52b4b9c666da3c86" + "1.4.313.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/vulkan-sdk-1.4.313.0.tar.gz" + sha256: "555ac780ccceca926fa25775834639ce6ffc744120bfb68fb8657dd4032d21ee" + "1.3.268.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "8cfb4824f185bc246cd41cceedbfcdf14abd3d2fa861512baf81df8a263b9283" + "1.3.261.1": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "eb1f9c2ff0a1409151d7749fb37bc1988dc1fd908444c1e4f43d4190c90befcd" + "1.3.243.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "18b8f296874ac19d034bfb9060238c87b6d67a39af0dfd305d3252762c265f9f" + "1.3.239.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "8b040328c18399b7bbf5bef84fac3d7b7376b39ec6833b7e19b7961bf7a72017" + "1.3.236.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "fb6f323a36efcd98766bb72f598008f73c4c92bce69c79fc98ad2b3cdca0c263" + "1.2.198.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "b2a0541caf01de4fc411cbb32c805a3bd0f6578432e532c5fa6336d187a4a1b1" diff --git a/glslang/all/conanfile.py b/glslang/all/conanfile.py new file mode 100644 index 0000000..ea1d493 --- /dev/null +++ b/glslang/all/conanfile.py @@ -0,0 +1,231 @@ +import os +import re + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +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 copy, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=2.1" + + +class GlslangConan(ConanFile): + name = "glslang" + description = "Khronos-reference front end for GLSL/ESSL, partial front " \ + "end for HLSL, and a SPIR-V generator." + license = "DocumentRef-LICENSE.txt:LicenseRef-glslang" + topics = ("glsl", "hlsl", "spirv", "spir-v", "validation", "translation") + homepage = "https://github.com/KhronosGroup/glslang" + 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], + "build_executables": [True, False], + "spv_remapper": [True, False], + "hlsl": [True, False], + "enable_optimizer": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executables": True, + "spv_remapper": True, + "hlsl": True, + "enable_optimizer": True, + } + + short_paths = True + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "1.4.341.0": + del self.options.spv_remapper + + 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.options.enable_optimizer: + if Version(self.version) >= "1.4.341.0": + self.requires(f"spirv-tools/{self.version}@{self.user}/{self.channel}") + else: + self.requires(f"spirv-tools/{self.version}") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + # see https://github.com/KhronosGroup/glslang/issues/2283 + if self.options.shared: + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} shared library build is broken on {self.settings.os}") + + if self.options.enable_optimizer and self.dependencies["spirv-tools"].options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} with enable_optimizer requires static spirv-tools, " + "because SPIRV-Tools-opt is not built if shared" + ) + + def build_requirements(self): + if Version(self.version) >= "1.3.261": + 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.variables["BUILD_EXTERNAL"] = False + tc.variables["SKIP_GLSLANG_INSTALL"] = False + tc.cache_variables["GLSLANG_ENABLE_INSTALL"] = True + tc.variables["ENABLE_SPVREMAPPER"] = self.options.get_safe("spv_remapper", False) + tc.variables["ENABLE_GLSLANG_BINARIES"] = self.options.build_executables + tc.variables["ENABLE_GLSLANG_JS"] = False + tc.variables["ENABLE_GLSLANG_WEBMIN"] = False + tc.variables["ENABLE_GLSLANG_WEBMIN_DEVEL"] = False + tc.variables["ENABLE_EMSCRIPTEN_SINGLE_FILE"] = False + tc.variables["ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE"] = False + tc.variables["ENABLE_HLSL"] = self.options.hlsl + tc.variables["ENABLE_RTTI"] = True + tc.variables["ENABLE_OPT"] = self.options.enable_optimizer + if self.options.enable_optimizer: + tc.variables["spirv-tools_SOURCE_DIR"] = self.dependencies["spirv-tools"].package_folder.replace("\\", "/") + tc.variables["ENABLE_PCH"] = False + tc.variables["ENABLE_CTEST"] = False + tc.variables["USE_CCACHE"] = False + tc.variables["OVERRIDE_MSVCCRT"] = False + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # glslang builds intermediate static libs, but Conan does not set -fPIC for shared builds + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + if Version(self.version) < "1.3.224.1": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + for cmake_file in sorted(self.source_path.rglob("CMakeLists.txt")): + content = cmake_file.read_text(encoding="utf8") + if "POSITION_INDEPENDENT_CODE ON" in content: + content = re.sub(r"set_property\(TARGET \S+ PROPERTY POSITION_INDEPENDENT_CODE ON\)\n", "", content) + content = content.replace("POSITION_INDEPENDENT_CODE ON", "") + cmake_file.write_text(content, encoding="utf8") + self.output.info(f"Patched fPIC handling in {cmake_file.relative_to(self.source_path)}") + if "POSITION_INDEPENDENT_CODE" in content: + raise ConanException(f"POSITION_INDEPENDENT_CODE found in {cmake_file}, please update the recipe") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, 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, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "glslang") + self.cpp_info.set_property("cmake_target_name", "glslang::_glslang-do-not-use") # because glslang-core target is glslang::glslang + + lib_suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + + has_machineindependent = not self.options.shared + has_genericcodegen = not self.options.shared + has_osdependent = not self.options.shared + + # removed - see CHANGES.md + has_oglcompiler = not self.options.shared and Version(self.version) <= "1.3.243" + has_hlsl = self.options.hlsl and Version(self.version) <= "1.3.243" + + # glslang + self.cpp_info.components["glslang-core"].set_property("cmake_target_name", "glslang::glslang") + self.cpp_info.components["glslang-core"].libs = [f"glslang{lib_suffix}"] + if self.options.shared: + self.cpp_info.components["glslang-core"].defines.append("GLSLANG_IS_SHARED_LIBRARY") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["glslang-core"].system_libs.extend(["m", "pthread"]) + if has_machineindependent: + self.cpp_info.components["glslang-core"].requires.append("machineindependent") + if has_genericcodegen: + self.cpp_info.components["glslang-core"].requires.append("genericcodegen") + if has_osdependent: + self.cpp_info.components["glslang-core"].requires.append("osdependent") + if has_oglcompiler: + self.cpp_info.components["glslang-core"].requires.append("oglcompiler") + if has_hlsl: + self.cpp_info.components["glslang-core"].defines.append("ENABLE_HLSL") + + if has_machineindependent: + # MachineIndependent + self.cpp_info.components["machineindependent"].set_property("cmake_target_name", "glslang::MachineIndependent") + self.cpp_info.components["machineindependent"].libs = [f"MachineIndependent{lib_suffix}"] + if has_genericcodegen: + self.cpp_info.components["machineindependent"].requires.append("genericcodegen") + if has_osdependent: + self.cpp_info.components["machineindependent"].requires.append("osdependent") + if has_oglcompiler: + self.cpp_info.components["machineindependent"].requires.append("oglcompiler") + + if has_genericcodegen: + # GenericCodeGen + self.cpp_info.components["genericcodegen"].set_property("cmake_target_name", "glslang::GenericCodeGen") + self.cpp_info.components["genericcodegen"].libs = [f"GenericCodeGen{lib_suffix}"] + + if has_osdependent: + # OSDependent + self.cpp_info.components["osdependent"].set_property("cmake_target_name", "glslang::OSDependent") + self.cpp_info.components["osdependent"].libs = [f"OSDependent{lib_suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["osdependent"].system_libs.append("pthread") + + if has_oglcompiler: + # OGLCompiler + self.cpp_info.components["oglcompiler"].set_property("cmake_target_name", "glslang::OGLCompiler") + self.cpp_info.components["oglcompiler"].libs = [f"OGLCompiler{lib_suffix}"] + + # SPIRV + self.cpp_info.components["spirv"].set_property("cmake_target_name", "glslang::SPIRV") + self.cpp_info.components["spirv"].libs = [f"SPIRV{lib_suffix}"] + self.cpp_info.components["spirv"].requires = ["glslang-core"] + if self.options.enable_optimizer: + self.cpp_info.components["spirv"].requires.append("spirv-tools::spirv-tools-opt") + self.cpp_info.components["spirv"].defines.append("ENABLE_OPT") + + # HLSL + if has_hlsl: + self.cpp_info.components["hlsl"].set_property("cmake_target_name", "glslang::HLSL") + self.cpp_info.components["hlsl"].libs = [f"HLSL{lib_suffix}"] + self.cpp_info.components["glslang-core"].requires.append("hlsl") + + # SPVRemapper + if self.options.get_safe("spv_remapper"): + self.cpp_info.components["spvremapper"].set_property("cmake_target_name", "glslang::SPVRemapper") + self.cpp_info.components["spvremapper"].libs = [f"SPVRemapper{lib_suffix}"] + + if Version(self.version) >= "1.3.243": + self.cpp_info.components["glslang-default-resource-limits"].set_property("cmake_target_name", "glslang::glslang-default-resource-limits") + self.cpp_info.components["glslang-default-resource-limits"].libs = [f"glslang-default-resource-limits{lib_suffix}"] diff --git a/glslang/all/test_package/CMakeLists.txt b/glslang/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..51e0b65 --- /dev/null +++ b/glslang/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(glslang REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glslang::glslang) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/glslang/all/test_package/conanfile.py b/glslang/all/test_package/conanfile.py new file mode 100644 index 0000000..ee5a5cf --- /dev/null +++ b/glslang/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" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(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") + shader_name = os.path.join(self.source_folder, "test_package.vert") + self.run(f"glslangValidator \"{shader_name}\"", env="conanrun") diff --git a/glslang/all/test_package/test_package.cpp b/glslang/all/test_package/test_package.cpp new file mode 100644 index 0000000..1d4ef3e --- /dev/null +++ b/glslang/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + glslang::InitializeProcess(); + glslang::FinalizeProcess(); + + return 0; +} diff --git a/glslang/all/test_package/test_package.vert b/glslang/all/test_package/test_package.vert new file mode 100644 index 0000000..8f349ee --- /dev/null +++ b/glslang/all/test_package/test_package.vert @@ -0,0 +1,8 @@ +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 0) in vec2 inPosition; + +void main() { + gl_Position = vec4(inPosition, 0.0, 1.0); +} diff --git a/glslang/config.yml b/glslang/config.yml new file mode 100644 index 0000000..e4e456f --- /dev/null +++ b/glslang/config.yml @@ -0,0 +1,17 @@ +versions: + "1.4.341.0": + folder: all + "1.4.313.0": + folder: all + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.2.198.0": + folder: all diff --git a/imgui/all/CMakeLists.txt b/imgui/all/CMakeLists.txt new file mode 100644 index 0000000..3ff4d57 --- /dev/null +++ b/imgui/all/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 3.9) +project(imgui LANGUAGES CXX) + +set(MISC_DIR ${IMGUI_SRC_DIR}/misc) +set(EXTRA_FONTS_DIR ${MISC_DIR}/fonts) +set(IMGUI_EXPORT_HEADERS imgui_export_headers.h) + +file(GLOB SOURCE_FILES ${IMGUI_SRC_DIR}/*.cpp) +file(GLOB HEADER_FILES ${IMGUI_SRC_DIR}/*.h) + +if(IMGUI_ENABLE_TEST_ENGINE) + message(STATUS "Building ImGui with test engine") + file(GLOB TEST_ENGINE_FILES ${IMGUI_TEST_ENGINE_DIR}/imgui_test_engine/*.cpp) + list(APPEND SOURCE_FILES ${TEST_ENGINE_FILES}) + file(GLOB TEST_ENGINE_HEADER_FILES ${IMGUI_TEST_ENGINE_DIR}/imgui_test_engine/*.h) + list(APPEND HEADER_FILES ${TEST_ENGINE_HEADER_FILES}) +else() + message(STATUS "Building ImGui without test engine") +endif() + +file(GLOB EXTRA_FONTS_FILES ${EXTRA_FONTS_DIR}/*.ttf) +if (MSVC) + file(GLOB EXTRA_NATVIS_FILES ${MISC_DIR}/natvis/*.natvis) +endif() + +set(BINARY_TO_COMPRESSED_BIN binary_to_compressed_c) + +add_executable(${BINARY_TO_COMPRESSED_BIN} ${EXTRA_FONTS_DIR}/binary_to_compressed_c.cpp) +target_compile_features(${BINARY_TO_COMPRESSED_BIN} PRIVATE cxx_std_11) + +add_library(${PROJECT_NAME} ${SOURCE_FILES}) + +if(IMGUI_WITH_SDL3_BINDING) + target_sources(${PROJECT_NAME} PRIVATE ${IMGUI_SRC_DIR}/backends/imgui_impl_sdl3.cpp) + list(APPEND HEADER_FILES ${IMGUI_SRC_DIR}/backends/imgui_impl_sdl3.h) + find_package(SDL3 REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PUBLIC SDL3::SDL3) +endif() + +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON +) +include(GenerateExportHeader) +generate_export_header(${PROJECT_NAME} + EXPORT_MACRO_NAME IMGUI_API + EXPORT_FILE_NAME ${IMGUI_EXPORT_HEADERS} +) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ + $ +) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ${BINARY_TO_COMPRESSED_BIN} + DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ${HEADER_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${IMGUI_EXPORT_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +install(FILES ${EXTRA_FONTS_FILES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/res/fonts + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +if (MSVC) + install(FILES ${EXTRA_NATVIS_FILES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/res/natvis + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +endif() diff --git a/imgui/all/conandata.yml b/imgui/all/conandata.yml new file mode 100644 index 0000000..dbd7bd6 --- /dev/null +++ b/imgui/all/conandata.yml @@ -0,0 +1,108 @@ +# this package's recipe relies on version suffixes to handle imgui's docking branch. +# Suffix: -docking for docking branch sources +sources: + "1.92.8-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.92.8-docking.tar.gz" + sha256: "ca0653454ed371b7a87e9b0bc29a5d15c9be7f7c0fbe778042fc48c71df1d3d8" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.92.8.tar.gz" + sha256: "66411ef3a0b7d42183a96cba079bceef8fa2c79f5d3507f8a183cbcc1d33ecc2" + "1.92.7-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.92.7-docking.tar.gz" + sha256: "2c58e28c957497eba0ed01c48a0bc5f118ec5f10a1c3721ba9436253a623bd72" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.92.7.tar.gz" + sha256: "3bb2320044854abb479facdde01c38c8af2e0257a630eb4b582b100a4fa60043" + "1.92.6": + core: + url: "https://github.com/ocornut/imgui/archive/v1.92.6.tar.gz" + sha256: "5b17c01f69545bde732b14936d89ce0f508adb83e8b56fa82448371845172bc3" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.92.6.tar.gz" + sha256: "5374ec2318933f9fc663d924529ea80e5fa40866e82fafc3872ae94a16fdbc7f" + "1.92.6-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.92.6-docking.tar.gz" + sha256: "5e84cdaa6a6041586a0d11a3071b749734a0439d66fdbdad37ae5b27e37d396c" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.92.6.tar.gz" + sha256: "5374ec2318933f9fc663d924529ea80e5fa40866e82fafc3872ae94a16fdbc7f" + "1.92.2b": + core: + url: "https://github.com/ocornut/imgui/archive/v1.92.2b.tar.gz" + sha256: "da3d453cce74e0fb3d67f8d798a2a8d04fcaf0b33ce0e0131d0695dfc4f64191" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.92.2.tar.gz" + sha256: "5914327269b2dd9ad66bead3be8577f99f5f572d196bbe4028f6812cf0356adb" + "1.92.2b-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.92.2b-docking.tar.gz" + sha256: "f6ad86e6f938fdda4d5e362b9a9b39158963dd3257fdc9902efc148c0c0c39f9" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.92.2.tar.gz" + sha256: "5914327269b2dd9ad66bead3be8577f99f5f572d196bbe4028f6812cf0356adb" + "1.91.8": + core: + url: "https://github.com/ocornut/imgui/archive/v1.91.8.tar.gz" + sha256: "db3a2e02bfd6c269adf0968950573053d002f40bdfb9ef2e4a90bce804b0f286" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.91.8.tar.gz" + sha256: "bdfc31cb819bd6e4df2d5da0316edf92b1011d1c4046293aafd9ae14106570e2" + "1.91.8-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.91.8-docking.tar.gz" + sha256: "55f5e65abea635f2a8bfa9a92cd966448a363a262cf6dead7cc662fb0ab37612" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.91.8.tar.gz" + sha256: "bdfc31cb819bd6e4df2d5da0316edf92b1011d1c4046293aafd9ae14106570e2" + "1.90.9": + core: + url: "https://github.com/ocornut/imgui/archive/v1.90.9.tar.gz" + sha256: "04943919721e874ac75a2f45e6eb6c0224395034667bf508923388afda5a50bf" + "1.90.9-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.90.9-docking.tar.gz" + sha256: "48e7e4e4f154ad98d0946126a84e2375f849f6a67792129a805817dd60a34330" + "1.90.5": + core: + url: "https://github.com/ocornut/imgui/archive/v1.90.5.tar.gz" + sha256: "e94b48dba7311c85ba8e3e6fe7c734d76a0eed21b2b42c5180fd5706d1562241" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.90.5.tar.gz" + sha256: "79339246d8c919c5926df0a7bee99be585ebaf67cdaba89a0ac314b1f7846f92" + "1.90.5-docking": + core: + url: "https://github.com/ocornut/imgui/archive/v1.90.5-docking.tar.gz" + sha256: "8a5e1e594d6c8552e46e4c1ba8dd9deb51262067f04937904babc04384533ccc" + testengine: + url: "https://github.com/ocornut/imgui_test_engine/archive/v1.90.5.tar.gz" + sha256: "79339246d8c919c5926df0a7bee99be585ebaf67cdaba89a0ac314b1f7846f92" + "1.88": + core: + url: "https://github.com/ocornut/imgui/archive/v1.88.tar.gz" + sha256: "9f14c788aee15b777051e48f868c5d4d959bd679fc5050e3d2a29de80d8fd32e" + "1.87": + core: + url: "https://github.com/ocornut/imgui/archive/v1.87.tar.gz" + sha256: "b54ceb35bda38766e36b87c25edf7a1cd8fd2cb8c485b245aedca6fb85645a20" + "1.86": + core: + url: "https://github.com/ocornut/imgui/archive/v1.86.tar.gz" + sha256: "6ba6ae8425a19bc52c5e067702c48b70e4403cd339cba02073a462730a63e825" + "1.85": + core: + url: "https://github.com/ocornut/imgui/archive/v1.85.tar.gz" + sha256: "7ed49d1f4573004fa725a70642aaddd3e06bb57fcfe1c1a49ac6574a3e895a77" +patches: + "1.92.4": + - patch_file: "patches/1.92.4-0001-static-linking-bugfix-backport.patch" + patch_description: "Add missing export for a function needed by the backends" + patch_source: "https://github.com/ocornut/imgui/pull/9016" + patch_type: "backport" + "1.92.4-docking": + - patch_file: "patches/1.92.4-docking-0001-static-linking-bugfix-backport.patch" + patch_description: "Add missing export for a function needed by the backends" + patch_source: "https://github.com/ocornut/imgui/pull/9016" + patch_type: "backport" diff --git a/imgui/all/conanfile.py b/imgui/all/conanfile.py new file mode 100644 index 0000000..f1da700 --- /dev/null +++ b/imgui/all/conanfile.py @@ -0,0 +1,127 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class IMGUIConan(ConanFile): + name = "imgui" + description = "Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ocornut/imgui" + topics = ("gui", "graphical", "bloat-free") + package_type = "library" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_test_engine": [True, False], + "with_sdl3_binding": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_test_engine": False, + "with_sdl3_binding": False, + } + + def requirements(self): + if self.options.get_safe("with_sdl3_binding"): + self.requires("sdl/[>3 <4]", transitive_headers=True) + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if "testengine" not in self.conan_data["sources"][self.version]: + self.output.warning("No test engine found for this version, removing test engine option") + del self.options.enable_test_engine + + # sdl3 bindings were introduced with 1.89.3 + # 1.91.8 is the oldest version that supports the latest sdl headers + if Version(self.version) < "1.91.8": + del self.options.with_sdl3_binding + + 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]["core"], strip_root=True) + if "testengine" in self.conan_data["sources"][self.version]: + get(self, **self.conan_data["sources"][self.version]["testengine"], strip_root=True, destination="test_engine") + self._patch_sources() + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["IMGUI_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["IMGUI_WITH_SDL3_BINDING"] = self.options.get_safe("with_sdl3_binding", False) + # test engine is not available for all versions + if self.options.get_safe("enable_test_engine"): + tc.preprocessor_definitions["IMGUI_ENABLE_TEST_ENGINE"] = "1" + tc.preprocessor_definitions["IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL"] = "1" + tc.variables["IMGUI_ENABLE_TEST_ENGINE"] = "ON" + tc.variables["IMGUI_TEST_ENGINE_DIR"] = os.path.join(self.source_folder, "test_engine").replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Ensure we take into account export_headers + replace_in_file(self, + os.path.join(self.source_folder, "imgui.h"), + "#ifdef IMGUI_USER_CONFIG", + "#include \"imgui_export_headers.h\"\n\n#ifdef IMGUI_USER_CONFIG" + ) + + 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, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + backends_folder = os.path.join(self.source_folder, "backends") + copy(self, pattern="imgui_impl_*", + dst=os.path.join(self.package_folder, "res", "bindings"), + src=backends_folder) + copy(self, pattern="imgui*.cpp", + dst=os.path.join(self.package_folder, "res", "src"), + src=os.path.join(self.source_folder)) + copy(self, pattern="*.*", + dst=os.path.join(self.package_folder, "res", "misc", "cpp"), + src=os.path.join(self.source_folder, "misc", "cpp")) + copy(self, pattern="*.*", + dst=os.path.join(self.package_folder, "res", "misc", "freetype"), + src=os.path.join(self.source_folder, "misc", "freetype")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + _is_docking_branch = "docking" in str(self.version) + self.conf_info.define("user.imgui:with_docking", _is_docking_branch) + self.cpp_info.libs = ["imgui"] + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("imm32") + self.cpp_info.srcdirs = [os.path.join("res", "bindings")] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH env var with : {}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/imgui/all/patches/1.92.4-0001-static-linking-bugfix-backport.patch b/imgui/all/patches/1.92.4-0001-static-linking-bugfix-backport.patch new file mode 100644 index 0000000..7da3242 --- /dev/null +++ b/imgui/all/patches/1.92.4-0001-static-linking-bugfix-backport.patch @@ -0,0 +1,15 @@ +diff --git imgui.h imgui.h +index 0a216b76..baeda39b 100644 +--- imgui.h ++++ imgui.h +@@ -3978,8 +3978,8 @@ struct ImGuiPlatformIO + // Functions + //------------------------------------------------------------------ + +- void ClearPlatformHandlers(); // Clear all Platform_XXX fields. Typically called on Platform Backend shutdown. +- void ClearRendererHandlers(); // Clear all Renderer_XXX fields. Typically called on Renderer Backend shutdown. ++ IMGUI_API void ClearPlatformHandlers(); // Clear all Platform_XXX fields. Typically called on Platform Backend shutdown. ++ IMGUI_API void ClearRendererHandlers(); // Clear all Renderer_XXX fields. Typically called on Renderer Backend shutdown. + }; + + // (Optional) Support for IME (Input Method Editor) via the platform_io.Platform_SetImeDataFn() function. Handler is called during EndFrame(). diff --git a/imgui/all/patches/1.92.4-docking-0001-static-linking-bugfix-backport.patch b/imgui/all/patches/1.92.4-docking-0001-static-linking-bugfix-backport.patch new file mode 100644 index 0000000..e8df467 --- /dev/null +++ b/imgui/all/patches/1.92.4-docking-0001-static-linking-bugfix-backport.patch @@ -0,0 +1,15 @@ +diff --git imgui.h imgui.h +index d0f071d2..8328e9a3 100644 +--- imgui.h ++++ imgui.h +@@ -4235,8 +4235,8 @@ struct ImGuiPlatformIO + // Functions + //------------------------------------------------------------------ + +- void ClearPlatformHandlers(); // Clear all Platform_XXX fields. Typically called on Platform Backend shutdown. +- void ClearRendererHandlers(); // Clear all Renderer_XXX fields. Typically called on Renderer Backend shutdown. ++ IMGUI_API void ClearPlatformHandlers(); // Clear all Platform_XXX fields. Typically called on Platform Backend shutdown. ++ IMGUI_API void ClearRendererHandlers(); // Clear all Renderer_XXX fields. Typically called on Renderer Backend shutdown. + }; + + // (Optional) This is required when enabling multi-viewport. Represent the bounds of each connected monitor/display and their DPI. diff --git a/imgui/all/test_package/CMakeLists.txt b/imgui/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..588bf94 --- /dev/null +++ b/imgui/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(imgui REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE imgui::imgui) + +option(DOCKING "Test docking" OFF) + +if (DOCKING) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DDOCKING) +endif() + +if(ENABLE_TEST_ENGINE) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DENABLE_TEST_ENGINE) +endif() + +target_compile_definitions(${PROJECT_NAME} PUBLIC "IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/my_imgui_config.h\"") +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/imgui/all/test_package/conanfile.py b/imgui/all/test_package/conanfile.py new file mode 100644 index 0000000..6fedd6a --- /dev/null +++ b/imgui/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + with_docking = self.dependencies[self.tested_reference_str].conf_info.get("user.imgui:with_docking", False) + with_test_engine = self.dependencies[self.tested_reference_str].options.get_safe("enable_test_engine", False) + tc = CMakeToolchain(self) + tc.variables["DOCKING"] = with_docking + tc.variables["ENABLE_TEST_ENGINE"] = with_test_engine + 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") diff --git a/imgui/all/test_package/my_imgui_config.h b/imgui/all/test_package/my_imgui_config.h new file mode 100644 index 0000000..69f4176 --- /dev/null +++ b/imgui/all/test_package/my_imgui_config.h @@ -0,0 +1,11 @@ +#pragma once + +#include + + +namespace ImGui +{ + void MyFunction(const char* name) { + printf(" ImGui::MyFunction(%s)\n", name); + } +} diff --git a/imgui/all/test_package/test_package.cpp b/imgui/all/test_package/test_package.cpp new file mode 100644 index 0000000..71df5a4 --- /dev/null +++ b/imgui/all/test_package/test_package.cpp @@ -0,0 +1,33 @@ +#include +#ifdef DOCKING + #include +#endif +#ifdef ENABLE_TEST_ENGINE +#include +#endif + +#include + +int main(int, char**) +{ + printf("IMGUI VERSION: %s\n", IMGUI_VERSION); + ImGui::CreateContext(); +#ifdef DOCKING + printf(" with docking\n"); +#endif + +#ifdef ENABLE_TEST_ENGINE + printf(" with test engine\n"); + ImGuiTestEngine *engine = ImGuiTestEngine_CreateContext(); + if (engine == NULL) { + printf(" Failed to create test engine context\n"); + return -1; + } + ImGui::DestroyContext(); + ImGuiTestEngine_DestroyContext(engine); +#else + ImGui::DestroyContext(); +#endif + + return 0; +} diff --git a/imgui/config.yml b/imgui/config.yml new file mode 100644 index 0000000..1bacfca --- /dev/null +++ b/imgui/config.yml @@ -0,0 +1,33 @@ +versions: + "1.92.8-docking": + folder: all + "1.92.7-docking": + folder: all + "1.92.6": + folder: all + "1.92.6-docking": + folder: all + "1.92.2b": + folder: all + "1.92.2b-docking": + folder: all + "1.91.8": + folder: all + "1.91.8-docking": + folder: all + "1.90.9": + folder: all + "1.90.9-docking": + folder: all + "1.90.5": + folder: all + "1.90.5-docking": + folder: all + "1.88": + folder: all + "1.87": + folder: all + "1.86": + folder: all + "1.85": + 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..a61a1ef --- /dev/null +++ b/lodepng/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20260210": + url: "https://github.com/lvandeve/lodepng/archive/9a857a004f2828f287fdd8a6d3ab454eebe07166.tar.gz" + sha256: "071307b36cb5d102df2e7045cd6e69674b7137087755dd2c55ac4a1147df28f6" + "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..078e520 --- /dev/null +++ b/lodepng/config.yml @@ -0,0 +1,7 @@ +versions: + "cci.20260210": + folder: all + "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..329f1f1 --- /dev/null +++ b/meshoptimizer/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.2": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v1.2.tar.gz" + sha256: "e40f71b809cdf3361b9a4def85fd44534e8733ce29d4b943c145b76859e4c2b4" + "1.1": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v1.1.tar.gz" + sha256: "b787011f81b4b3069c2f9065b7c191efdd4189a49be32ba5282dd5579f05261a" + "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..8fd202b --- /dev/null +++ b/meshoptimizer/config.yml @@ -0,0 +1,9 @@ +versions: + "1.2": + folder: all + "1.1": + folder: all + "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..d309109 --- /dev/null +++ b/mimalloc/all/conandata.yml @@ -0,0 +1,89 @@ +sources: + "3.3.2": + url: "https://github.com/microsoft/mimalloc/archive/v3.3.2.tar.gz" + sha256: "ca02384e007f46950598500dfaebde5ff9948c1d231f5a81b058799afa64bbbb" + "3.3.1": + url: "https://github.com/microsoft/mimalloc/archive/v3.3.1.tar.gz" + sha256: "42c16914168ac6741eeb407e83b93a12b2b7ee25a7e14e6b4807fab8b577a540" + "3.2.8": + url: "https://github.com/microsoft/mimalloc/archive/v3.2.8.tar.gz" + sha256: "68163666575518c213a6593850099adce3863b340ca2751103dbd1f253664e05" + "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..21779db --- /dev/null +++ b/mimalloc/all/conanfile.py @@ -0,0 +1,258 @@ +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], + "asan": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "secure": False, + "override": False, + "inject": False, + "single_object": False, + "guarded": False, + "win_redirect": False, + "asan": 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") + + if self.options.override and \ + self.options.asan: + raise ConanInvalidConfiguration( + "Asan requires Mimalloc to be compiled without override") + + # 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) + tc.variables["MI_TRACK_ASAN"] = "ON" if self.options.get_safe("asan") else "OFF" + 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): + if(self.options.asan): + self.cpp_info.set_property("cmake_file_name", "mimalloc-asan") + self.cpp_info.set_property("cmake_target_name", "mimalloc-asan") + else: + 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..054c4cd --- /dev/null +++ b/mimalloc/config.yml @@ -0,0 +1,29 @@ +versions: + "3.3.2": + folder: all + "3.3.1": + folder: all + "3.2.8": + folder: all + "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/mold/README.md b/mold/README.md new file mode 100644 index 0000000..8a1ee68 --- /dev/null +++ b/mold/README.md @@ -0,0 +1,22 @@ +# mold: A Modern Linker + +mold is a faster drop-in replacement for existing Unix linkers. It is several +times quicker than the LLVM lld linker, the second-fastest open-source linker. +mold aims to enhance developer productivity by minimizing build time, +particularly in rapid debug-edit-rebuild cycles. + +You can configure Conan to download the latest version of `mold` and use it as the linker +when building your dependencies and projects from source. Currently only supported +when targeting Linux as the platform. + +To use mold automatically as the linker, you can add the following section to your +_host_ profile that targets Linux. When using gcc, please note that the following +flags require gcc 12.1 or greater. + +``` +[tool_requires] +*:mold/[*] +[conf] +tools.build:exelinkflags=['-fuse-ld=mold'] +tools.build:sharedlinkflags=['-fuse-ld=mold'] +``` diff --git a/mold/all/conandata.yml b/mold/all/conandata.yml new file mode 100644 index 0000000..0292492 --- /dev/null +++ b/mold/all/conandata.yml @@ -0,0 +1,39 @@ +sources: + "2.41.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.41.0.tar.gz" + sha256: "0a61abac85d818437b425df856822e9d6e9982baeae5a93bcb02fe6c0060c61a" + "2.40.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.40.1.tar.gz" + sha256: "d1ce09a69941f8158604c3edcc96c7178231e7dba2da66b20f5ef6e112c443b7" + "2.36.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.36.0.tar.gz" + sha256: "3f57fe75535500ecce7a80fa1ba33675830b7d7deb1e5ee9a737e2bc43cdb1c7" + "2.34.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.34.1.tar.gz" + sha256: "a8cf638045b4a4b2697d0bcc77fd96eae93d54d57ad3021bf03b0333a727a59d" + "2.33.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.33.0.tar.gz" + sha256: "37b3aacbd9b6accf581b92ba1a98ca418672ae330b78fe56ae542c2dcb10a155" + "2.32.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.32.1.tar.gz" + sha256: "f3c9a527d884c635834fe7d79b3de959b00783bf9446280ea274d996f0335825" + "2.32.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.32.0.tar.gz" + sha256: "4b7e4146ea0f52be9adae8b417399f3676a041e65b55e3f25f088120d30a320b" + "2.31.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.31.0.tar.gz" + sha256: "3dc3af83a5d22a4b29971bfad17261851d426961c665480e2ca294e5c74aa1e5" + "2.4.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.4.0.tar.gz" + sha256: "be65f3d785d32ece7b3204ecaa57810847fdd25c232cf704cbfff2dafb1ac107" + "2.0.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.0.0.tar.gz" + sha256: "2ae8a22db09cbff626df74c945079fa29c1e5f60bbe02502dcf69191cf43527b" + "1.11.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.11.0.tar.gz" + sha256: "99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f" +patches: + "2.40.1": + - patch_file: "patches/2.40.1/0001-patch-enforce-c-11-for-tbb.patch" + patch_description: "Fix bundled oneTBB build by enforcing C++11 standard" + patch_type: "conan" diff --git a/mold/all/conanfile.py b/mold/all/conanfile.py new file mode 100644 index 0000000..5f6f907 --- /dev/null +++ b/mold/all/conanfile.py @@ -0,0 +1,125 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv + +required_conan_version = ">2.0" + + +class MoldConan(ConanFile): + name = "mold" + description = ( + "mold is a faster drop-in replacement for existing Unix linkers. " + "It is several times faster than the LLVM lld linker." + ) + license = ("AGPL-3.0", "MIT") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rui314/mold/" + topics = ("ld", "linkage", "compilation", "pre-built") + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_mimalloc": [True, False], + } + default_options = { + "with_mimalloc": False, + } + + def configure(self): + if Version(self.version) < "2.0.0": + self.license = "AGPL-3.0" + else: + self.license = "MIT" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + self.requires("xxhash/0.8.2") + if self.options.with_mimalloc: + self.requires("mimalloc/3.3.1@bigfootdev/main") + if Version(self.version) < "2.2.0": + # Newer versions use vendored-in BLAKE3 + self.requires("openssl/[>=1.1 <4]") + + def package_id(self): + del self.info.settings.compiler + + def validate_build(self): + # perform these checks in validate_build() - since the compiler is removed from the package_id, + # this lets the compatibility plugin consider the executable built with other compilers + if Version(self.version) >= "2.34.0": + # mold has required C+20 since 1.4.1. However, C++20 features are used for the first time in 2.34.0. + check_min_cppstd(self, 20) + if self.settings.compiler in ["gcc", "clang", "intel-cc"] and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration('Mold can only be built with libstdc++11; specify mold:compiler.libcxx=libstdc++11 in your build profile') + if self.settings.compiler == "msvc": + raise ConanInvalidConfiguration(f'{self.name} can not be built on {self.settings.os}.') + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("GCC version 10 or higher required") + if self.settings.compiler in ('clang', 'apple-clang') and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("Clang version 12 or higher required") + if Version(self.version) >= "2.34.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14": + raise ConanInvalidConfiguration("Apple-Clang version 14 or higher required due to C++20 features") + if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : + raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') + if Version(self.version) == "2.33.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14": + raise ConanInvalidConfiguration(f'{self.ref} doesn\'t support Apple-Clang < 14.') + + def build_requirements(self): + self.tool_requires("cmake/[>=3.18.0 <4]") + + 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["MOLD_USE_MIMALLOC"] = self.options.with_mimalloc + tc.variables["MOLD_USE_SYSTEM_MIMALLOC"] = True + tc.variables["MOLD_USE_SYSTEM_TBB"] = False # see https://github.com/conan-io/conan-center-index/pull/23575#issuecomment-2059154281 + tc.variables["CMAKE_INSTALL_LIBEXECDIR"] = "libexec" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + vbe = VirtualBuildEnv(self) + vbe.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread", "dl"] + + bindir = os.path.join(self.package_folder, "bin") + mold_executable = os.path.join(bindir, "mold") + self.conf_info.define("user.mold:path", mold_executable) + self.buildenv_info.define_path("MOLD_ROOT", bindir) + self.buildenv_info.define("LD", mold_executable) diff --git a/mold/all/patches/2.40.1/0001-patch-enforce-c-11-for-tbb.patch b/mold/all/patches/2.40.1/0001-patch-enforce-c-11-for-tbb.patch new file mode 100644 index 0000000..499279e --- /dev/null +++ b/mold/all/patches/2.40.1/0001-patch-enforce-c-11-for-tbb.patch @@ -0,0 +1,28 @@ +From 2f29fc752620180d88e82792adb2ff8a1d886bd1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim=20Friedrich=20Br=C3=BCggemann?= + +Date: Tue, 17 Jun 2025 09:48:43 +0200 +Subject: [PATCH] patch: Enforce C++11 for TBB + +--- + third-party/tbb/CMakeLists.txt | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/third-party/tbb/CMakeLists.txt b/third-party/tbb/CMakeLists.txt +index 12273b3e..21c4e2ef 100644 +--- a/third-party/tbb/CMakeLists.txt ++++ b/third-party/tbb/CMakeLists.txt +@@ -77,9 +77,7 @@ include(CMakeDependentOption) + # --------------------------------------------------------------------------------------------------------- + # Handle C++ standard version. + if (NOT MSVC) # no need to cover MSVC as it uses C++14 by default. +- if (NOT CMAKE_CXX_STANDARD) +- set(CMAKE_CXX_STANDARD 11) +- endif() ++ set(CMAKE_CXX_STANDARD 11) + + if (CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) # if standard option was detected by CMake + set(CMAKE_CXX_STANDARD_REQUIRED ON) +-- +2.25.1 + diff --git a/mold/all/test_package/conanfile.py b/mold/all/test_package/conanfile.py new file mode 100644 index 0000000..639ee9a --- /dev/null +++ b/mold/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class MoldTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("mold -v", env="conanrun") diff --git a/mold/config.yml b/mold/config.yml new file mode 100644 index 0000000..d70a0d8 --- /dev/null +++ b/mold/config.yml @@ -0,0 +1,23 @@ +versions: + "2.41.0": + folder: all + "2.40.1": + folder: all + "2.36.0": + folder: all + "2.34.1": + folder: all + "2.33.0": + folder: all + "2.32.1": + folder: all + "2.32.0": + folder: all + "2.31.0": + folder: all + "2.4.0": + folder: all + "2.0.0": + folder: all + "1.11.0": + 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..b942ded --- /dev/null +++ b/shaderc/all/conandata.yml @@ -0,0 +1,75 @@ +sources: + "2026.1": + url: "https://github.com/google/shaderc/archive/refs/tags/v2026.1.tar.gz" + sha256: "245002feccbe7f8361b223545a5654cea69780745886872d7efff50a38d96c66" + "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: + "2026.1": + - patch_file: "patches/2025.3/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2026.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" + "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 + "2026.1": "1.4.341.0" + "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..b26db23 --- /dev/null +++ b/shaderc/all/conanfile.py @@ -0,0 +1,138 @@ +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 + if Version(self.version) >= "1.4.341.0": + self.requires(f"glslang/{self._spirv_version}@{self.user}/{self.channel}") + self.requires(f"spirv-tools/{self._spirv_version}@{self.user}/{self.channel}") + self.requires(f"spirv-headers/{self._spirv_version}@{self.user}/{self.channel}") + else: + 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/patches/2026.1/adapt-update_build_version.py.patch b/shaderc/all/patches/2026.1/adapt-update_build_version.py.patch new file mode 100644 index 0000000..0c13021 --- /dev/null +++ b/shaderc/all/patches/2026.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 +@@ -130,18 +130,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/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..32d621b --- /dev/null +++ b/shaderc/config.yml @@ -0,0 +1,11 @@ +versions: + "2026.1": + folder: all + "2025.3": + folder: all + "2024.1": + folder: all + "2023.6": + folder: all + "2021.1": + folder: all diff --git a/spirv-cross/all/conandata.yml b/spirv-cross/all/conandata.yml new file mode 100644 index 0000000..5658344 --- /dev/null +++ b/spirv-cross/all/conandata.yml @@ -0,0 +1,38 @@ +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.4.341.0.tar.gz" + sha256: "b2665ac9ddb65ff75a7ca2f6d410e73da443692742a1e3a5b7728ca6069a400c" + "1.4.321.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.4.321.0.tar.gz" + sha256: "6037555620c27105bf1d4068a6eeb4b0d7953630d556a1ca9799dfe06fd2fb68" + "1.4.313.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.4.313.0.tar.gz" + sha256: "7d1de24918bea9897753f7561d4d154f68ec89c36bb70c13598222b8039d4212" + "1.4.309.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "cf4f12a767d63f63024e61750e372ffdc95567513b99ed9be6f21f474b328ddd" + "1.3.296.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "4f7f9a8a643e6694f155712016b9b572c13a9444e65b3f43b27bb464c0ab76e0" + "1.3.268.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "dd656a51ba4c229c1a0bb220b7470723e8fd4b68abb7f2cf2ca4027df824f4a0" + "1.3.261.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "a5cf99ed62e93800232e50b782890321d4d7e053dcaa71bd8efc0c48a00bd1dd" + "1.3.250.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.250.1.tar.gz" + sha256: "5b7402d7078eeffca0926875b1dcd0f5dd78791a30529de7c8456686f6fc52ce" + "1.3.246.1": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.246.1.tar.gz" + sha256: "44d1aef7e6e247b4b7ec6a1ef0bbb43cc9b681ee689393db90ac815d240808b1" + "1.3.243.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "549fff809de2b3484bcc5d710ccd76ca29cbd764dd304c3687252e2f3d034e06" + "1.3.239.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "a1695022880e7ef3c2d407647f79876045dc2a3ed012753adc71ead5cc5178ba" + # commit used in Vulkan SDK 1.2.198.0 + "cci.20211113": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/7c3cb0b12c9965497b08403c82ac1b82846fa7be.tar.gz" + sha256: "5bb6837e2b75db1a9e36e7d6eac40d905e3460ff3b5234f391adc6bdf6aadcdf" diff --git a/spirv-cross/all/conanfile.py b/spirv-cross/all/conanfile.py new file mode 100644 index 0000000..d98d3ab --- /dev/null +++ b/spirv-cross/all/conanfile.py @@ -0,0 +1,206 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class SpirvCrossConan(ConanFile): + name = "spirv-cross" + description = "SPIRV-Cross is a practical tool and library for performing " \ + "reflection on SPIR-V and disassembling SPIR-V back to high level languages." + license = "Apache-2.0" + topics = ("reflection", "disassembler", "spirv", "spir-v", "glsl", "hlsl") + homepage = "https://github.com/KhronosGroup/SPIRV-Cross" + 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], + "build_executable": [True, False], + "exceptions": [True, False], + "glsl": [True, False], + "hlsl": [True, False], + "msl": [True, False], + "cpp": [True, False], + "reflect": [True, False], + "c_api": [True, False], + "util": [True, False], + "namespace": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executable": True, + "exceptions": True, + "glsl": True, + "hlsl": True, + "msl": True, + "cpp": True, + "reflect": True, + "c_api": True, + "util": True, + "namespace": "spirv_cross", + } + + 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") + # these options don't contribute to shared binary + del self.options.c_api + del self.options.util + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not self.options.glsl and \ + (self.options.hlsl or self.options.msl or self.options.cpp or self.options.reflect): + raise ConanInvalidConfiguration("hlsl, msl, cpp and reflect require glsl enabled") + + if self.options.build_executable and \ + not (self.options.glsl and self.options.hlsl and self.options.msl and + self.options.cpp and self.options.reflect and self.options.get_safe("util", True)): + raise ConanInvalidConfiguration("executable can't be built without glsl, hlsl, msl, cpp, reflect and util") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS"] = not self.options.exceptions + tc.variables["SPIRV_CROSS_SHARED"] = self.options.shared + tc.variables["SPIRV_CROSS_STATIC"] = not self.options.shared or self.options.build_executable + tc.variables["SPIRV_CROSS_CLI"] = self.options.build_executable + tc.variables["SPIRV_CROSS_ENABLE_TESTS"] = False + tc.variables["SPIRV_CROSS_ENABLE_GLSL"] = self.options.glsl + tc.variables["SPIRV_CROSS_ENABLE_HLSL"] = self.options.hlsl + tc.variables["SPIRV_CROSS_ENABLE_MSL"] = self.options.msl + tc.variables["SPIRV_CROSS_ENABLE_CPP"] = self.options.cpp + tc.variables["SPIRV_CROSS_ENABLE_REFLECT"] = self.options.reflect + tc.variables["SPIRV_CROSS_ENABLE_C_API"] = self.options.get_safe("c_api", True) + tc.variables["SPIRV_CROSS_ENABLE_UTIL"] = self.options.get_safe("util", False) or self.options.build_executable + tc.variables["SPIRV_CROSS_SKIP_INSTALL"] = False + tc.variables["SPIRV_CROSS_FORCE_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.options.namespace + tc.generate() + + def build(self): + apply_conandata_patches(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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.ilk", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.shared and self.options.build_executable: + for static_lib in [ + "spirv-cross-core", "spirv-cross-glsl", "spirv-cross-hlsl", "spirv-cross-msl", + "spirv-cross-cpp", "spirv-cross-reflect", "spirv-cross-c", "spirv-cross-util", + ]: + rm(self, f"*{static_lib}.*", os.path.join(self.package_folder, "lib")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {target: f"spirv-cross::{target}" for target in self._spirv_cross_components.keys()}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _spirv_cross_components(self): + components = {} + if self.options.shared: + components.update({"spirv-cross-c-shared": []}) + else: + components.update({"spirv-cross-core": []}) + if self.options.glsl: + components.update({"spirv-cross-glsl": ["spirv-cross-core"]}) + if self.options.hlsl: + components.update({"spirv-cross-hlsl": ["spirv-cross-glsl"]}) + if self.options.msl: + components.update({"spirv-cross-msl": ["spirv-cross-glsl"]}) + if self.options.cpp: + components.update({"spirv-cross-cpp": ["spirv-cross-glsl"]}) + if self.options.reflect: + components.update({"spirv-cross-reflect": []}) + if self.options.c_api: + c_api_requires = [] + if self.options.glsl: + c_api_requires.append("spirv-cross-glsl") + if self.options.hlsl: + c_api_requires.append("spirv-cross-hlsl") + if self.options.msl: + c_api_requires.append("spirv-cross-msl") + if self.options.cpp: + c_api_requires.append("spirv-cross-cpp") + if self.options.reflect: + c_api_requires.append("spirv-cross-reflect") + components.update({"spirv-cross-c": c_api_requires}) + if self.options.util: + components.update({"spirv-cross-util": ["spirv-cross-core"]}) + return components + + def package_info(self): + # FIXME: we should provide one CMake config file per target (waiting for an implementation of https://github.com/conan-io/conan/issues/9000) + def _register_component(target_lib, requires): + self.cpp_info.components[target_lib].set_property("cmake_target_name", target_lib) + if self.options.shared: + self.cpp_info.components[target_lib].set_property("pkg_config_name", target_lib) + prefix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + self.cpp_info.components[target_lib].libs = [f"{target_lib}{prefix}"] + self.cpp_info.components[target_lib].includedirs.append(os.path.join("include", "spirv_cross")) + self.cpp_info.components[target_lib].defines.append(f"SPIRV_CROSS_NAMESPACE_OVERRIDE={self.options.namespace}") + self.cpp_info.components[target_lib].requires = requires + if self.settings.os in ["Linux", "FreeBSD"] and self.options.glsl: + self.cpp_info.components[target_lib].system_libs.append("m") + if not self.options.shared and self.options.c_api: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components[target_lib].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.components[target_lib].names["cmake_find_package"] = target_lib + self.cpp_info.components[target_lib].names["cmake_find_package_multi"] = target_lib + self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + + for target_lib, requires in self._spirv_cross_components.items(): + _register_component(target_lib, requires) + + # TODO: to remove in conan v2 once legacy generators removed + if self.options.build_executable: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/spirv-cross/all/test_package/CMakeLists.txt b/spirv-cross/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..c3b57d8 --- /dev/null +++ b/spirv-cross/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +# FIXME: this is not the official way to find spirv-cross components +find_package(spirv-cross REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET spirv-cross-c) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c) +elseif(TARGET spirv-cross-c-shared) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c-shared) +endif() diff --git a/spirv-cross/all/test_package/conanfile.py b/spirv-cross/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/spirv-cross/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/spirv-cross/all/test_package/test_package.c b/spirv-cross/all/test_package/test_package.c new file mode 100644 index 0000000..dd59cdc --- /dev/null +++ b/spirv-cross/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include + +int main() { + spvc_context context; + spvc_context_create(&context); + spvc_context_destroy(context); + + unsigned major, minor, patch; + spvc_get_version(&major, &minor, &patch); + printf("SPIRV-Cross: C API version %u.%u.%u\n", major, minor, patch); + + return 0; +} diff --git a/spirv-cross/config.yml b/spirv-cross/config.yml new file mode 100644 index 0000000..2bd9418 --- /dev/null +++ b/spirv-cross/config.yml @@ -0,0 +1,25 @@ +versions: + "1.4.341.0": + folder: all + "1.4.321.0": + folder: all + "1.4.313.0": + folder: all + "1.4.309.0": + folder: all + "1.3.296.0": + folder: all + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all + "1.3.250.1": + folder: all + "1.3.246.1": + folder: all + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "cci.20211113": + folder: all diff --git a/spirv-headers/all/conandata.yml b/spirv-headers/all/conandata.yml new file mode 100644 index 0000000..965b109 --- /dev/null +++ b/spirv-headers/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.4.341.0.tar.gz" + sha256: "cab0a654c4917e16367483296b44cdb1d614e3120c721beafcd37e3a8580486c" + "1.4.313.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.4.313.0.tar.gz" + sha256: "f68be549d74afb61600a1e3a7d1da1e6b7437758c8e77d664909f88f302c5ac1" + "1.4.309.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "a96f8b4f2dfb18f7432e5c523e220ab0075372a9509e0c25fbff21c76af0de7c" + "1.3.296.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "1423d58a1171611d5aba2bf6f8c69c72ef9c38a0aca12c3493e4fda64c9b2dc6" + "1.3.268.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4" + "1.3.261.1": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "32b4c6ae6a2fa9b56c2c17233c8056da47e331f76e117729925825ea3e77a739" + "1.3.243.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "16927b1868e7891377d059cd549484e4158912439cf77451ae7e01e2a3bcd28b" + "1.3.239.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "fdaf6670e311cd1c08ae90bf813e89dd31630205bc60030ffd25fb0af39b51fe" + "1.2.198.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "3301a23aca0434336a643e433dcacacdd60000ab3dd35dc0078a297c06124a12" diff --git a/spirv-headers/all/conanfile.py b/spirv-headers/all/conanfile.py new file mode 100644 index 0000000..08920bf --- /dev/null +++ b/spirv-headers/all/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.50.0" + + +class SpirvheadersConan(ConanFile): + name = "spirv-headers" + homepage = "https://github.com/KhronosGroup/SPIRV-Headers" + description = "Header files for the SPIRV instruction set." + license = "MIT-KhronosGroup" + topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "khronos") + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPIRV_HEADERS_SKIP_EXAMPLES"] = True + if Version(self.version) > "1.3.275.0": + tc.variables["SPIRV_HEADERS_ENABLE_TESTS"] = False + if Version(self.version) <= "1.3.243.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + tc.generate() + + 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SPIRV-Headers") + self.cpp_info.set_property("cmake_target_name", "SPIRV-Headers::SPIRV-Headers") + self.cpp_info.set_property("pkg_config_name", "SPIRV-Headers") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/spirv-headers/all/test_package/CMakeLists.txt b/spirv-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..cc7ffe9 --- /dev/null +++ b/spirv-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(SPIRV-Headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SPIRV-Headers::SPIRV-Headers) diff --git a/spirv-headers/all/test_package/conanfile.py b/spirv-headers/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/spirv-headers/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/spirv-headers/all/test_package/test_package.cpp b/spirv-headers/all/test_package/test_package.cpp new file mode 100644 index 0000000..db6d549 --- /dev/null +++ b/spirv-headers/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2016 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are 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 Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE 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 +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +#include +#include +#include + +namespace { + +const GLSLstd450 kSin = GLSLstd450Sin; +const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos; +const spv::Op kNop = spv::OpNop; + +} + +int main(int argc, char ** argv) +{ + + return 0; +} diff --git a/spirv-headers/config.yml b/spirv-headers/config.yml new file mode 100644 index 0000000..15ac07d --- /dev/null +++ b/spirv-headers/config.yml @@ -0,0 +1,19 @@ +versions: + "1.4.341.0": + folder: all + "1.4.313.0": + folder: all + "1.4.309.0": + folder: all + "1.3.296.0": + folder: all + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.2.198.0": + folder: all diff --git a/spirv-tools/all/conandata.yml b/spirv-tools/all/conandata.yml new file mode 100644 index 0000000..20c6850 --- /dev/null +++ b/spirv-tools/all/conandata.yml @@ -0,0 +1,46 @@ +# Add only the SDK release versions from https://github.com/KhronosGroup/SPIRV-Tools/tags for consistency +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.4.341.0.tar.gz" + sha256: "15bfb678138cdf9cd1480dfb952547bbb66b763a735b6d5582578572f5c2e6f9" + "1.4.313.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.4.313.0.tar.gz" + sha256: "6b60f723345ceed5291cceebbcfacf7fea9361a69332261fa08ae57e2a562005" + "1.4.309.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "6b8577054c575573ead3ad71cb6a2c0b3397b64c746cc3c99e48cc5e324c1b55" + "1.3.268.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "4c19fdcffb5fe8ef8dc93d7a65ae78b64edc7a5688893ee381c57f70be77deaf" + "1.3.261.1": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "ead95c626ad482882a141d1aa0ce47b9453871f72c42c0b28d39c82f60a52008" + "1.3.243.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "684a29e37bfdc6e151fe1d3ec4b87c5396c17a439de545d81ea05d4ee6fbc86e" + "1.3.239.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "327b2dba4515646eee28c1a5fe1332891e81c8b6ff289363f52877f3e67c2d81" + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "6789c782a8ba8fa127c3d579f9362f0cdde7a9ccc2e8513cdf217bba579dfda9" + "1.2.198.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "e8a9fec946f8473129374ad6b98ee690ac9a4574ace7cb3b46bbeb4eddfdc33b" +patches: + "1.4.313.0": + - patch_file: "patches/0001-fix-clang-20-build-issue.patch" + patch_description: "fix clang-20 build issue" + patch_type: "backport" + "1.4.309.0": + - patch_file: "patches/0001-fix-clang-20-build-issue.patch" + patch_description: "fix clang-20 build issue" + patch_type: "backport" + "1.3.268.0": + - patch_file: "patches/0001-fix-clang-20-build-issue.patch" + patch_description: "fix clang-20 build issue" + patch_type: "backport" + "1.3.261.1": + - patch_file: "patches/0001-fix-clang-20-build-issue.patch" + patch_description: "fix clang-20 build issue" + patch_type: "backport" diff --git a/spirv-tools/all/conanfile.py b/spirv-tools/all/conanfile.py new file mode 100644 index 0000000..429fe40 --- /dev/null +++ b/spirv-tools/all/conanfile.py @@ -0,0 +1,202 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir, save, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.1" + + +class SpirvtoolsConan(ConanFile): + name = "spirv-tools" + homepage = "https://github.com/KhronosGroup/SPIRV-Tools/" + description = "Create and optimize SPIRV shaders" + topics = ("spirv", "spirv-v", "vulkan", "opengl", "opencl", "hlsl", "khronos") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_executables": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executables": True, + } + + short_paths = 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") + + def requirements(self): + if Version(self.version) >= "1.4.341.0": + self.requires(f"spirv-headers/{self.version}@{self.user}/{self.channel}") + else: + self.requires(f"spirv-headers/{self.version}") + + def validate_build(self): + # newer versions of the library require C++17 for internals + check_min_cppstd(self, 11 if Version(self.version) < "1.3.243" else 17) + + def validate(self): + # The interface requires C++11 + check_min_cppstd(self, 11) + + def build_requirements(self): + 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) + + #==================== + # Shared libs mess in Spirv-Tools (see https://github.com/KhronosGroup/SPIRV-Tools/issues/3909) + #==================== + # We have 2 solutions if shared True: + # - Only package SPIRV-Tools-shared lib (private symbols properly hidden), and wait resolution + # of above issue before allowing to build shared for all Spirv-Tools libs. + # - Build and package shared libs with all symbols exported + # (it would require CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS for msvc) + # Currently this recipe implements the first solution + + # Static and shared libs are controlled by a weird combination + # of SPIRV_TOOLS_BUILD_STATIC and BUILD_SHARED_LIBS. + tc.variables["SPIRV_TOOLS_BUILD_STATIC"] = True + #============ + + # Required by the project's CMakeLists.txt + tc.variables["SPIRV-Headers_SOURCE_DIR"] = self.dependencies["spirv-headers"].package_folder.replace("\\", "/") + + # There are some switch( ) statements that are causing errors + # need to turn this off + tc.variables["SPIRV_WERROR"] = False + + tc.variables["SKIP_SPIRV_TOOLS_INSTALL"] = False + tc.variables["SPIRV_LOG_DEBUG"] = False + tc.variables["SPIRV_SKIP_TESTS"] = True + tc.variables["SPIRV_CHECK_CONTEXT"] = False + tc.variables["SPIRV_BUILD_FUZZER"] = False + tc.variables["SPIRV_SKIP_EXECUTABLES"] = not self.options.build_executables + # To install relocatable shared libs on Macos + if Version(self.version) < "1.3.239": + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + # For iOS/tvOS/watchOS + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # CMAKE_POSITION_INDEPENDENT_CODE was set ON for the entire + # project in the lists file. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + 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")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-link")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-opt")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-reduce")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-lint")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-diff")) + rmdir(self, os.path.join(self.package_folder, "SPIRV-Tools-tools")) + if self.options.shared: + for file_name in [ + "*SPIRV-Tools", "*SPIRV-Tools-opt", "*SPIRV-Tools-link", + "*SPIRV-Tools-reduce", "*SPIRV-Tools-lint", + ]: + for ext in [".a", ".lib"]: + rm(self, f"{file_name}{ext}", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*SPIRV-Tools-shared.dll", os.path.join(self.package_folder, "bin")) + rm(self, "*SPIRV-Tools-shared*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SPIRV-Tools") + self.cpp_info.set_property("pkg_config_name", "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools") + + # SPIRV-Tools + self.cpp_info.components["spirv-tools-core"].set_property( + "cmake_target_name", + "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools-static", + ) + self.cpp_info.components["spirv-tools-core"].set_property("cmake_target_aliases", ["SPIRV-Tools"]) # before 2020.5, kept for conveniency + self.cpp_info.components["spirv-tools-core"].libs = ["SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools"] + self.cpp_info.components["spirv-tools-core"].requires = ["spirv-headers::spirv-headers"] + if self.options.shared: + self.cpp_info.components["spirv-tools-core"].defines = ["SPIRV_TOOLS_SHAREDLIB"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spirv-tools-core"].system_libs.extend(["m", "rt"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["spirv-tools-core"].system_libs.append(libcxx) + + # FIXME: others components should have their own CMake config file + if not self.options.shared: + # SPIRV-Tools-opt + self.cpp_info.components["spirv-tools-opt"].set_property("cmake_target_name", "SPIRV-Tools-opt") + self.cpp_info.components["spirv-tools-opt"].libs = ["SPIRV-Tools-opt"] + self.cpp_info.components["spirv-tools-opt"].requires = ["spirv-tools-core", "spirv-headers::spirv-headers"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["spirv-tools-opt"].system_libs.append("m") + + # SPIRV-Tools-link + self.cpp_info.components["spirv-tools-link"].set_property("cmake_target_name", "SPIRV-Tools-link") + self.cpp_info.components["spirv-tools-link"].libs = ["SPIRV-Tools-link"] + self.cpp_info.components["spirv-tools-link"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + # SPIRV-Tools-reduce + self.cpp_info.components["spirv-tools-reduce"].set_property("cmake_target_name", "SPIRV-Tools-reduce") + self.cpp_info.components["spirv-tools-reduce"].libs = ["SPIRV-Tools-reduce"] + self.cpp_info.components["spirv-tools-reduce"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + # SPIRV-Tools-lint + self.cpp_info.components["spirv-tools-lint"].set_property("cmake_target_name", "SPIRV-Tools-lint") + self.cpp_info.components["spirv-tools-lint"].libs = ["SPIRV-Tools-lint"] + self.cpp_info.components["spirv-tools-lint"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + # SPIRV-Tools-diff + self.cpp_info.components["spirv-tools-diff"].set_property("cmake_target_name", "SPIRV-Tools-diff") + self.cpp_info.components["spirv-tools-diff"].libs = ["SPIRV-Tools-diff"] + self.cpp_info.components["spirv-tools-diff"].requires = ["spirv-tools-core", "spirv-tools-opt"] + + if Version(self.version) < "1.3" and not self.options.shared: + del self.cpp_info.components["spirv-tools-diff"] diff --git a/spirv-tools/all/patches/0001-fix-clang-20-build-issue.patch b/spirv-tools/all/patches/0001-fix-clang-20-build-issue.patch new file mode 100644 index 0000000..0eb7aa5 --- /dev/null +++ b/spirv-tools/all/patches/0001-fix-clang-20-build-issue.patch @@ -0,0 +1,26 @@ +From 4b46b76c7c68f838f18906c6d3ca275eef207ca7 Mon Sep 17 00:00:00 2001 +From: Elvis Dukaj +Date: Thu, 24 Apr 2025 14:36:21 +0200 +Subject: [PATCH] fix clang-20 build issue + +--- + tools/diff/diff.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tools/diff/diff.cpp b/tools/diff/diff.cpp +index d60edb2e..349ec092 100644 +--- a/tools/diff/diff.cpp ++++ b/tools/diff/diff.cpp +@@ -87,7 +87,8 @@ std::unique_ptr load_module(const char* path) { + return spvtools::BuildModule( + kDefaultEnvironment, spvtools::utils::CLIMessageConsumer, + std::string(contents.begin(), contents.end()), +- spvtools::SpirvTools::kDefaultAssembleOption | ++ static_cast( ++ spvtools::SpirvTools::kDefaultAssembleOption) | + SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); + } + +-- +2.43.0 + diff --git a/spirv-tools/all/test_package/CMakeLists.txt b/spirv-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..8e5e8c8 --- /dev/null +++ b/spirv-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(SPIRV-Tools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME}_c test_package.c) +if(TARGET SPIRV-Tools-shared) + target_link_libraries(${PROJECT_NAME}_c PRIVATE SPIRV-Tools-shared) +elseif(TARGET SPIRV-Tools-static) + target_link_libraries(${PROJECT_NAME}_c PRIVATE SPIRV-Tools-static) +else() + target_link_libraries(${PROJECT_NAME}_c PRIVATE SPIRV-Tools) +endif() + +# TODO: we should call find_package(SPIRV-Tools-opt REQUIRED CONFIG), but not modeled right now +if(TARGET SPIRV-Tools-opt) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE SPIRV-Tools-opt) + if(SPIRV-Tools_VERSION VERSION_LESS "1.3.243.0") + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + else() + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_17) + endif() +endif() diff --git a/spirv-tools/all/test_package/conanfile.py b/spirv-tools/all/test_package/conanfile.py new file mode 100644 index 0000000..d8eaf2a --- /dev/null +++ b/spirv-tools/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +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_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") + bin_path_cpp = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + if os.path.exists(bin_path_cpp): + self.run(bin_path_cpp, env="conanrun") diff --git a/spirv-tools/all/test_package/test_package.c b/spirv-tools/all/test_package/test_package.c new file mode 100644 index 0000000..932428d --- /dev/null +++ b/spirv-tools/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "spirv-tools/libspirv.h" + +int main(int argc, char ** argv) +{ +const char input_text[] = + "OpCapability Shader\n" + "OpCapability Linkage\n" + "OpMemoryModel Logical GLSL450"; + spv_text text; + spv_binary binary; + spv_context context; + + context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1); + + binary = 0; + if( SPV_SUCCESS != spvTextToBinary(context, input_text, sizeof(input_text), &binary, 0) ) + { + return 1; + } + + text = 0; + if( SPV_SUCCESS != spvBinaryToText(context, binary->code, binary->wordCount, 0, &text, 0) ) + { + return 1; + } + + spvTextDestroy(text); + spvBinaryDestroy(binary); + spvContextDestroy(context); + return 0; +} diff --git a/spirv-tools/all/test_package/test_package.cpp b/spirv-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000..a1e22c7 --- /dev/null +++ b/spirv-tools/all/test_package/test_package.cpp @@ -0,0 +1,65 @@ +// Copyright (c) 2016 Google Inc. +// +// 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. + +// This program demonstrates basic SPIR-V module processing using +// SPIRV-Tools C++ API: +// * Assembling +// * Validating +// * Optimizing +// * Disassembling + +#include +#include +#include + +#include "spirv-tools/libspirv.hpp" +#include "spirv-tools/optimizer.hpp" + +int main() { + const std::string source = + " OpCapability Linkage " + " OpCapability Shader " + " OpMemoryModel Logical GLSL450 " + " OpSource GLSL 450 " + " OpDecorate %spec SpecId 1 " + " %int = OpTypeInt 32 1 " + " %spec = OpSpecConstant %int 0 " + "%const = OpConstant %int 42"; + + spvtools::SpirvTools core(SPV_ENV_UNIVERSAL_1_3); + spvtools::Optimizer opt(SPV_ENV_UNIVERSAL_1_3); + + auto print_msg_to_stderr = [](spv_message_level_t, const char*, + const spv_position_t&, const char* m) { + std::cerr << "error: " << m << std::endl; + }; + core.SetMessageConsumer(print_msg_to_stderr); + opt.SetMessageConsumer(print_msg_to_stderr); + + std::vector spirv; + if (!core.Assemble(source, &spirv)) return 1; + if (!core.Validate(spirv)) return 1; + + opt.RegisterPass(spvtools::CreateSetSpecConstantDefaultValuePass({{1, "42"}})) + .RegisterPass(spvtools::CreateFreezeSpecConstantValuePass()) + .RegisterPass(spvtools::CreateUnifyConstantPass()) + .RegisterPass(spvtools::CreateStripDebugInfoPass()); + if (!opt.Run(spirv.data(), spirv.size(), &spirv)) return 1; + + std::string disassembly; + if (!core.Disassemble(spirv, &disassembly)) return 1; + std::cout << disassembly << "\n"; + + return 0; +} diff --git a/spirv-tools/config.yml b/spirv-tools/config.yml new file mode 100644 index 0000000..6acb045 --- /dev/null +++ b/spirv-tools/config.yml @@ -0,0 +1,19 @@ +versions: + "1.4.341.0": + folder: all + "1.4.313.0": + folder: all + "1.4.309.0": + folder: all + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.3.236.0": + folder: all + "1.2.198.0": + 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..5f0f9a5 --- /dev/null +++ b/sqlite3/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "3.53.3": + url: "https://sqlite.org/2026/sqlite-amalgamation-3530300.zip" + sha256: "646421e12aac110282ef8cc68f1a62d4bb15fc7b8f09da0b53e29ee690500431" + "3.53.1": + url: "https://sqlite.org/2026/sqlite-amalgamation-3530100.zip" + sha256: "36ad6e7f38540a3b21a2ac36340833f0a9e426bc1c752751c3ba669466827eae" + "3.51.2": + url: "https://sqlite.org/2026/sqlite-amalgamation-3510200.zip" + sha256: "6e2a845a493026bdbad0618b2b5a0cf48584faab47384480ed9f592d912f23ec" + "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..2e59ba4 --- /dev/null +++ b/sqlite3/config.yml @@ -0,0 +1,17 @@ +versions: + "3.53.3": + folder: all + "3.53.1": + folder: all + "3.51.2": + folder: all + "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-headers/all/conandata.yml b/vulkan-headers/all/conandata.yml new file mode 100644 index 0000000..90d6bff --- /dev/null +++ b/vulkan-headers/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.4.341.0.tar.gz" + sha256: "d73bc5036b6556b741f6985ff600ca720308c5f2850e4a43ceb498bd3de069e7" + "1.4.313.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.4.313.0.tar.gz" + sha256: "20743c99a96c07290f24377360e7a12bdd2c465ba202e0c7ef2ec25d446cf61d" + "1.4.309.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "2bc1b4127950badc80212abf1edfa5c3b5032f3425edf37255863ba7592c1969" + "1.3.296.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "1e872a0be3890784bbe68dcd89b7e017fed77ba95820841848718c98bda6dc33" + "1.3.290.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.290.0.tar.gz" + sha256: "5b186e1492d97c44102fe858fb9f222b55524a8b6da940a8795c9e326ae6d722" + "1.3.268.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "94993cbe2b1a604c0d5d9ea37a767e1aba4d771d2bfd4ddceefd66243095164f" + "1.3.261.1": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "7a25ebdb6325e626dc5d33bc937b289ccce7ddb7b0ac1a1b1d5d7ff33b6715d3" + "1.3.250.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.250.0.tar.gz" + sha256: "0da601a81b868bc543ec09ab7e514d1b059774993dfce81df7150f432c8bf33a" + "1.3.243.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "29ddb2ef931f5fb0cabd1a78398f9c4da44d37f8c8a1e110f834f4c260c9d548" + "1.3.239.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.239.0.tar.gz" + sha256: "865fa8e8e8314fcca60777a92f50bd0cf612205a36e719d6975482d3366f619e" + "1.2.198.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "34782c61cad9b3ccf2fa0a31ec397d4fce99490500b4f3771cb1a48713fece80" diff --git a/vulkan-headers/all/conanfile.py b/vulkan-headers/all/conanfile.py new file mode 100644 index 0000000..beae2e7 --- /dev/null +++ b/vulkan-headers/all/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class VulkanHeadersConan(ConanFile): + name = "vulkan-headers" + description = "Vulkan Header files." + license = "Apache-2.0" + topics = ("vulkan-headers", "vulkan") + homepage = "https://github.com/KhronosGroup/Vulkan-Headers" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + package_id_embed_mode = "patch_mode" + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*", src=os.path.join(self.source_folder, "registry"), dst=os.path.join(self.package_folder, "res", "vulkan", "registry")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "VulkanHeaders") + self.cpp_info.components["vulkanheaders"].set_property("cmake_target_name", "Vulkan::Headers") + self.cpp_info.components["vulkanheaders"].bindirs = [] + self.cpp_info.components["vulkanheaders"].libdirs = [] + self.cpp_info.components["vulkanregistry"].set_property("cmake_target_name", "Vulkan::Registry") + self.cpp_info.components["vulkanregistry"].includedirs = [os.path.join("res", "vulkan", "registry")] + self.cpp_info.components["vulkanregistry"].bindirs = [] + self.cpp_info.components["vulkanregistry"].libdirs = [] + self.cpp_info.components["vulkanregistry"].resdirs = ["res"] + + self.cpp_info.filenames["cmake_find_package"] = "VulkanHeaders" + self.cpp_info.filenames["cmake_find_package_multi"] = "VulkanHeaders" + self.cpp_info.names["cmake_find_package"] = "Vulkan" + self.cpp_info.names["cmake_find_package_multi"] = "Vulkan" + self.cpp_info.components["vulkanheaders"].names["cmake_find_package"] = "Headers" + self.cpp_info.components["vulkanheaders"].names["cmake_find_package_multi"] = "Headers" + self.cpp_info.components["vulkanregistry"].names["cmake_find_package"] = "Registry" + self.cpp_info.components["vulkanregistry"].names["cmake_find_package_multi"] = "Registry" diff --git a/vulkan-headers/all/test_package/CMakeLists.txt b/vulkan-headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..1290ec0 --- /dev/null +++ b/vulkan-headers/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(VulkanHeaders REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} Vulkan::Headers) diff --git a/vulkan-headers/all/test_package/conanfile.py b/vulkan-headers/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/vulkan-headers/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-headers/all/test_package/test_package.c b/vulkan-headers/all/test_package/test_package.c new file mode 100644 index 0000000..defd9fd --- /dev/null +++ b/vulkan-headers/all/test_package/test_package.c @@ -0,0 +1,21 @@ +#include + +int main() { + VkApplicationInfo appInfo; + appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; + appInfo.pApplicationName = "Hello Conan"; + appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.pEngineName = "Dummy Engine"; + appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.apiVersion = VK_API_VERSION_1_0; + + VkInstanceCreateInfo createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + createInfo.pApplicationInfo = &appInfo; + createInfo.enabledLayerCount = 0; + createInfo.ppEnabledLayerNames = NULL; + createInfo.enabledExtensionCount = 0; + createInfo.ppEnabledExtensionNames = NULL; + + return 0; +} diff --git a/vulkan-headers/config.yml b/vulkan-headers/config.yml new file mode 100644 index 0000000..ae28f53 --- /dev/null +++ b/vulkan-headers/config.yml @@ -0,0 +1,23 @@ +versions: + "1.4.341.0": + folder: all + "1.4.313.0": + folder: all + "1.4.309.0": + folder: all + "1.3.296.0": + folder: all + "1.3.290.0": + folder: all + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all + "1.3.250.0": + folder: all + "1.3.243.0": + folder: all + "1.3.239.0": + folder: all + "1.2.198.0": + 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..77f0af9 --- /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(f"vulkan-headers/1.4.341.0@{self.user}/{self.channel}") + + 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..6d666f0 --- /dev/null +++ b/vulkan-utility-libraries/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/Vulkan-Utility-Libraries/archive/refs/heads/vulkan-sdk-1.4.341.tar.gz" + sha256: "a9e0611238558e108f6cc1df6e21ae00c8a935f9a8a0003c88d8de1fc4acec65" + "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..f8e89b3 --- /dev/null +++ b/vulkan-utility-libraries/all/conanfile.py @@ -0,0 +1,78 @@ +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 +from conan.tools.scm import Version +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): + if Version(self.version) >= "1.4.341.0": + self.requires(f"vulkan-headers/{self.version}@{self.user}/{self.channel}", transitive_headers=True) + else: + 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..7b0ab11 --- /dev/null +++ b/vulkan-utility-libraries/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.341.0": + folder: all + "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..5b01255 --- /dev/null +++ b/vulkan-validationlayers/all/conandata.yml @@ -0,0 +1,60 @@ +sources: + "1.4.341.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/vulkan-sdk-1.4.341.0.tar.gz" + sha256: "7f521490495e43561f70fe8b6317fd5cc13d4083413f1abf891f50cbabe12238" + "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..b587402 --- /dev/null +++ b/vulkan-validationlayers/all/conanfile.py @@ -0,0 +1,279 @@ +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") + if Version(conan_version).minor >= "1.4.341": + self.requires(f"{self._require("spirv-headers")}@{self.user}/{self.channel}") + else: + self.requires(self._require("spirv-headers")) + if Version(conan_version).minor >= "1.4.313": + self.requires(f"{self._require("vulkan-utility-libraries")}@{self.user}/{self.channel}", 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: + if Version(conan_version).minor >= "1.4.341": + self.requires(f"{self._require("spirv-tools")}@{self.user}/{self.channel}") + else: + self.requires(self._require("spirv-tools")) + if Version(conan_version).minor >= "1.4.341": + self.requires(f"{self._require("vulkan-headers")}@{self.user}/{self.channel}", transitive_headers=True) + else: + 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/dependencies/dependencies-1.4.341.0.yml b/vulkan-validationlayers/all/dependencies/dependencies-1.4.341.0.yml new file mode 100644 index 0000000..2138a35 --- /dev/null +++ b/vulkan-validationlayers/all/dependencies/dependencies-1.4.341.0.yml @@ -0,0 +1,4 @@ +spirv-headers: "1.4.341.0" +spirv-tools: "1.4.341.0" +vulkan-headers: "1.4.341.0" +vulkan-utility-libraries: "1.4.341.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..fe4071b --- /dev/null +++ b/vulkan-validationlayers/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.10) +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..2df7881 --- /dev/null +++ b/vulkan-validationlayers/config.yml @@ -0,0 +1,19 @@ +versions: + "1.4.341.0": + folder: all + "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