Inital commit
Conan Packaging / Package assimp/6.0.5 (push) Failing after 0s
Conan Packaging / Package cli11/2.6.2 (push) Failing after 0s
Conan Packaging / Package eabase/01082025 (push) Failing after 0s
Conan Packaging / Package flatbuffers/25.12.19-2026-02-06-03fffb2-bigfoot (push) Failing after 0s
Conan Packaging / Package glm/1.0.3 (push) Failing after 0s
Conan Packaging / Package imgui/1.92.8-docking (push) Failing after 1s
Conan Packaging / Package lodepng/cci.20260210 (push) Failing after 0s
Conan Packaging / Package meshoptimizer/1.2 (push) Failing after 0s
Conan Packaging / Package rapidhash/3.0 (push) Failing after 0s
Conan Packaging / Package spirv-cross/1.4.341.0 (push) Failing after 1s
Conan Packaging / Package spirv-headers/1.4.341.0 (push) Failing after 0s
Conan Packaging / Package unordered_dense/4.8.1 (push) Failing after 0s
Conan Packaging / Package spirv-tools/1.4.341.0 (push) Skipped
Conan Packaging / Package mimalloc/3.3.2 (push) Failing after 0s
Conan Packaging / Package mold/2.41.0 (push) Failing after 0s
Conan Packaging / Package pixelmatch-cpp17/1.0.3 (push) Failing after 0s
Conan Packaging / Package sqlite3/3.53.3 (push) Failing after 0s
Conan Packaging / Package stduuid/1.2.3 (push) Failing after 0s
Conan Packaging / Package vulkan-headers/1.4.341.0 (push) Failing after 0s
Conan Packaging / Package eastl/3.27.01 (push) Skipped
Conan Packaging / Package vulkan-memory-allocator/3.3.0 (push) Skipped
Conan Packaging / Package vulkan-utility-libraries/1.4.341.0 (push) Skipped
Conan Packaging / Package glslang/1.4.341.0 (push) Skipped
Conan Packaging / Package vulkan-validationlayers/1.4.341.0 (push) Skipped
Conan Packaging / Package shaderc/2026.1 (push) Skipped

This commit is contained in:
2026-08-17 01:07:23 +02:00
commit 02d1a0a13a
243 changed files with 8598 additions and 0 deletions
+242
View File
@@ -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
+2
View File
@@ -0,0 +1,2 @@
build
CMakeUserPresets.json
+30
View File
@@ -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()
+5
View File
@@ -0,0 +1,5 @@
include_guard()
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
+2
View File
@@ -0,0 +1,2 @@
[built-in options]
b_lto = true
+26
View File
@@ -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
+23
View File
@@ -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
+21
View File
@@ -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.
+43
View File
@@ -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()
+13
View File
@@ -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"
+329
View File
@@ -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)
+11
View File
@@ -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)
+29
View File
@@ -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")
+17
View File
@@ -0,0 +1,17 @@
#include <stdio.h>
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
int main(int argc, char **argv) {
const C_STRUCT aiScene *scene = aiImportFile("",
aiProcess_CalcTangentSpace |
aiProcess_Triangulate |
aiProcess_JoinIdenticalVertices |
aiProcess_SortByPType);
aiReleaseImport(scene);
return 0;
}
+16
View File
@@ -0,0 +1,16 @@
#include <iostream>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
int main(int argc, char **argv) {
Assimp::Importer importer;
const aiScene* scene = importer.ReadFile("",
aiProcess_CalcTangentSpace |
aiProcess_Triangulate |
aiProcess_JoinIdenticalVertices |
aiProcess_SortByPType);
return 0;
}
+9
View File
@@ -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"
+46
View File
@@ -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"
+96
View File
@@ -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"
+9
View File
@@ -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)
+26
View File
@@ -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")
+11
View File
@@ -0,0 +1,11 @@
#include <CLI/CLI.hpp>
#include <iostream>
int main(int argc, char **argv) {
CLI::App app("Test App");
CLI11_PARSE(app, argc, argv);
std::cout << app.help() << '\n';
return 0;
}
+31
View File
@@ -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
+21
View File
@@ -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"
+68
View File
@@ -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"
+13
View File
@@ -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)
#-------------------------------------------------------------------------------------------
+8
View File
@@ -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)
+27
View File
@@ -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")
+47
View File
@@ -0,0 +1,47 @@
#include <eabase.h>
#include <cstdlib>
#include <iostream>
#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;
}
@@ -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/)
+19
View File
@@ -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)
+11
View File
@@ -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"
+101
View File
@@ -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"
+152
View File
@@ -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"
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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 <typename T>
- auto try_add_pointer(int) -> type_identity<typename std::remove_reference<T>::type*>;
+ auto try_add_pointer(int) -> type_identity<typename eastl::remove_reference<T>::type*>;
template <typename T>
auto try_add_pointer(...) -> type_identity<T>;
}
@@ -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)
@@ -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)
@@ -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;
@@ -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)
@@ -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;
+8
View File
@@ -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)
+26
View File
@@ -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")
+16
View File
@@ -0,0 +1,16 @@
#include <EASTL/hash_map.h>
#include <new>
// 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<int, int> map;
map[0] = 1;
return 0;
}
+23
View File
@@ -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"
+31
View File
@@ -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()
+65
View File
@@ -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"
+158
View File
@@ -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"))
@@ -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")
@@ -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}")
@@ -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}")
@@ -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
@@ -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 $<TARGET_FILE:flatbuffers::flatc>
--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()
+39
View File
@@ -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")
+33
View File
@@ -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;
@@ -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<flatbuffers::Offset<Weapon>> 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<const Weapon *>(monster->equipped());
assert(equipped->name()->str() == "Axe");
assert(equipped->damage() == 5);
(void)equipped;
printf("The FlatBuffer was successfully created and verified!\n");
}
@@ -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 <cstdlib>
#include <iostream>
#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;
}
+35
View File
@@ -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
+10
View File
@@ -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"
+52
View File
@@ -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 = []
+7
View File
@@ -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)
+26
View File
@@ -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")
+11
View File
@@ -0,0 +1,11 @@
#include <cstdlib>
#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;
}
+7
View File
@@ -0,0 +1,7 @@
versions:
"1.0.3":
folder: all
"1.0.1":
folder: all
"0.9.9.8":
folder: all
+16
View File
@@ -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)
+26
View File
@@ -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"
+231
View File
@@ -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}"]
+8
View File
@@ -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)
+28
View File
@@ -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")
@@ -0,0 +1,8 @@
#include <glslang/Public/ShaderLang.h>
int main() {
glslang::InitializeProcess();
glslang::FinalizeProcess();
return 0;
}
@@ -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);
}
+17
View File
@@ -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
+74
View File
@@ -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
$<BUILD_INTERFACE:${IMGUI_SRC_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)
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()
+108
View File
@@ -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"
+127
View File
@@ -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)
@@ -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().
@@ -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.
+20
View File
@@ -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)
+35
View File
@@ -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")
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include <stdio.h>
namespace ImGui
{
void MyFunction(const char* name) {
printf(" ImGui::MyFunction(%s)\n", name);
}
}
+33
View File
@@ -0,0 +1,33 @@
#include <imgui.h>
#ifdef DOCKING
#include <imgui_internal.h>
#endif
#ifdef ENABLE_TEST_ENGINE
#include <imgui_te_engine.h>
#endif
#include <stdio.h>
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;
}
+33
View File
@@ -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
+12
View File
@@ -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})
+10
View File
@@ -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"
+68
View File
@@ -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")
+8
View File
@@ -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)
+26
View File
@@ -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")
+12
View File
@@ -0,0 +1,12 @@
#include <iostream>
#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;
}
@@ -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)
+17
View File
@@ -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)
+7
View File
@@ -0,0 +1,7 @@
versions:
"cci.20260210":
folder: all
"cci.20250727":
folder: all
"cci.20241228":
folder: all
+13
View File
@@ -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"
+71
View File
@@ -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)")
@@ -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)
@@ -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")
@@ -0,0 +1,9 @@
#include "meshoptimizer.h"
int main()
{
meshopt_encodeVertexVersion(0);
meshopt_encodeIndexVersion(1);
return 0;
}
+9
View File
@@ -0,0 +1,9 @@
versions:
"1.2":
folder: all
"1.1":
folder: all
"1.0":
folder: all
"0.25":
folder: all
+37
View File
@@ -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()

Some files were not shown because too many files have changed in this diff Show More