Skip to content

Commit

Permalink
Merge branch 'master' into pixman
Browse files Browse the repository at this point in the history
  • Loading branch information
db4 authored Aug 16, 2023
2 parents 2d7fb53 + da7183d commit 5b807c1
Show file tree
Hide file tree
Showing 13 changed files with 451 additions and 15 deletions.
4 changes: 4 additions & 0 deletions recipes/bgfx/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"cci.20230216":
url: "https://github.com/bkaradzic/bgfx/archive/9d5b980f5c060e54cc30dec18500a5b54db00405.tar.gz"
sha256: "291739720E369C5C2422273D887AEC590084B29E5C9DC5C9441F5A68869B6736"
321 changes: 321 additions & 0 deletions recipes/bgfx/all/conanfile.py

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions recipes/bgfx/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.8)

project(test_package LANGUAGES CXX)

find_package(bgfx REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
target_link_libraries(${PROJECT_NAME} bgfx::bgfx)
25 changes: 25 additions & 0 deletions recipes/bgfx/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

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

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

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
36 changes: 36 additions & 0 deletions recipes/bgfx/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//Important: bgfx shared on windows only works with the C99 API, the C++ API is not exported
#include <bx/platform.h>

#if BGFX_SHARED_LIB_USE && (BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT)
#include <bgfx/c99/bgfx.h>
#else
#include <bgfx/bgfx.h>
#endif

int main() {
#if BGFX_SHARED_LIB_USE && (BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT)
bgfx_init_t init;
bgfx_init_ctor(&init);
init.type = bgfx_renderer_type::BGFX_RENDERER_TYPE_NOOP;
init.vendorId = BGFX_PCI_ID_NONE;
init.platformData.nwh = nullptr;
init.platformData.ndt = nullptr;
init.resolution.width = 0;
init.resolution.height = 0;
init.resolution.reset = BGFX_RESET_NONE;
bgfx_init(&init);
bgfx_shutdown();
return 0;
#else
bgfx::Init init;
init.type = bgfx::RendererType::Noop;
init.vendorId = BGFX_PCI_ID_NONE;
init.platformData.nwh = nullptr;
init.platformData.ndt = nullptr;
init.resolution.width = 0;
init.resolution.height = 0;
init.resolution.reset = BGFX_RESET_NONE;
bgfx::init(init);
bgfx::shutdown();
#endif
}
9 changes: 9 additions & 0 deletions recipes/bgfx/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.8)

project(test_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/)
17 changes: 17 additions & 0 deletions recipes/bgfx/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
import os


class BimgTestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
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)
3 changes: 3 additions & 0 deletions recipes/bgfx/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"cci.20230216":
folder: all
14 changes: 7 additions & 7 deletions recipes/implot/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
cmake_minimum_required(VERSION 3.4)
project(implot CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(implot LANGUAGES CXX)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

file(GLOB SOURCE_FILES ${IMPLOT_SRC_DIR}/*.cpp)
file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h)

add_library(${PROJECT_NAME} ${SOURCE_FILES})
add_library(${PROJECT_NAME}
${IMPLOT_SRC_DIR}/implot.cpp
${IMPLOT_SRC_DIR}/implot_items.cpp
)
target_include_directories(${PROJECT_NAME} PRIVATE ${IMPLOT_SRC_DIR})

find_package(imgui CONFIG REQUIRED)

target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui)

target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_DEFINE_MATH_OPERATORS)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)

include(GNUInstallDirs)

Expand Down
3 changes: 3 additions & 0 deletions recipes/implot/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.15":
url: "https://github.com/epezent/implot/archive/v0.15.tar.gz"
sha256: "4c20f22fbfbe4ad055f3d344581918d62cde72070b233dad75419a4334f82146"
"0.14":
url: "https://github.com/epezent/implot/archive/v0.14.tar.gz"
sha256: "1613af3e6554c0a74de20c6e60e9bce5ce35c2d4f9e1aa5ff963f7fe2d48af88"
Expand Down
21 changes: 14 additions & 7 deletions recipes/implot/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import get, copy
from conan.tools.scm import Version
from conan.tools.microsoft import is_msvc
import os

required_conan_version = ">=1.54"

class ImplotConan(ConanFile):
name = "implot"
description = "Advanced 2D Plotting for Dear ImGui"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/epezent/implot"
description = "Advanced 2D Plotting for Dear ImGui"
topics = ("imgui", "plot", "graphics", )
license = "MIT"
settings = "os", "arch", "compiler", "build_type"
package_type = "library"

settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False]
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True
"fPIC": True,
}

def export_sources(self):
Expand All @@ -37,7 +38,9 @@ def configure(self):
self.options.rm_safe("fPIC")

def requirements(self):
if Version(self.version) >= "0.14":
if Version(self.version) >= "0.15":
self.requires("imgui/1.89.8", transitive_headers=True)
elif Version(self.version) >= "0.14":
self.requires("imgui/1.89.4", transitive_headers=True)
elif Version(self.version) >= "0.13":
# imgui 1.89 renamed ImGuiKeyModFlags_* to ImGuiModFlags_*
Expand All @@ -48,6 +51,10 @@ def requirements(self):
def layout(self):
cmake_layout(self, src_folder="src")

def validate(self):
if Version(self.version) < "0.13" and is_msvc(self) and self.dependencies["imgui"].options.shared:
raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared imgui.")

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

Expand Down
2 changes: 2 additions & 0 deletions recipes/implot/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.15":
folder: "all"
"0.14":
folder: "all"
"0.13":
Expand Down
2 changes: 1 addition & 1 deletion recipes/jwt-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def export_sources(self):
export_conandata_patches(self)

def requirements(self):
self.requires("openssl/[>1.1.1c,<1.1.1u]")
self.requires("openssl/[>=1.1 <4]")
if not self._supports_generic_json:
self.requires("picojson/1.3.0")

Expand Down

0 comments on commit 5b807c1

Please sign in to comment.