-
Notifications
You must be signed in to change notification settings - Fork 2k
diligent-core: migrate to Conan v2 #23347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bd3e36a
2f28e68
cdf7378
ab5b43d
f6f2369
b478306
3d8fffb
c39eb34
8754d20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
find_package(SPIRV-Tools REQUIRED CONFIG) | ||
find_package(spirv-cross REQUIRED CONFIG) | ||
find_package(volk REQUIRED CONFIG) | ||
find_package(xxHash REQUIRED CONFIG) | ||
|
||
if (NOT ${DILIGENT_NO_GLSLANG}) | ||
find_package(glslang REQUIRED CONFIG) | ||
add_library(glslang INTERFACE) | ||
target_link_libraries(glslang INTERFACE glslang::glslang) | ||
target_include_directories(glslang INTERFACE ${glslang_INCLUDE_DIR}/glslang) | ||
add_library(SPIRV ALIAS glslang::SPIRV) | ||
endif() | ||
|
||
add_library(SPIRV-Headers ALIAS SPIRV-Headers::SPIRV-Headers) | ||
add_library(spirv-tools-core ALIAS spirv-tools::spirv-tools) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,39 +21,23 @@ | |
url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API250014.tar.gz" | ||
sha256: "8f85fc55c6241f9215875df58a077f797e9134c9b51f330f1489df91d8553b7d" | ||
patches: | ||
"api.252003": | ||
- patch_file: "patches/0023-252003-fix-warning-as-error.patch" | ||
Check warning on line 25 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
"2.5.2": | ||
- patch_file: "patches/0014-252-exclude-tests.patch" | ||
Check warning on line 27 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0015-252-dont-install-3d-party-license.patch" | ||
Check warning on line 28 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0016-252-fix-glslang-usage.patch" | ||
Check warning on line 29 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0017-252-fix-glslang-include.patch" | ||
Check warning on line 30 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0018-252-fix-warning-as-error.patch" | ||
Check warning on line 31 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
"2.5.1": | ||
- patch_file: "patches/0001-remove_warning_as_error.patch" | ||
Check warning on line 33 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0002-use_conan_dependencies.patch" | ||
Check warning on line 34 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0003-use_volk_from_conan.patch" | ||
Check warning on line 35 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0005-spirv-cross-namespace-override.patch" | ||
Check warning on line 36 in recipes/diligent-core/all/conandata.yml
|
||
base_path: "source_subfolder" | ||
- patch_file: "patches/0006-install-linux-platform-header.diff" | ||
base_path: "source_subfolder" | ||
"api.250014": | ||
- patch_file: "patches/0007-API250014-remove_warning_as_error.patch" | ||
base_path: "source_subfolder" | ||
- patch_file: "patches/0009-API250014-use_conan_dependencies_in_third_party.patch" | ||
base_path: "source_subfolder" | ||
- patch_file: "patches/0010-API250014-use_volk_from_conan.patch" | ||
base_path: "source_subfolder" | ||
- patch_file: "patches/0013-API250014-use-vulkan-headers-in-archiver.patch" | ||
base_path: "source_subfolder" | ||
- patch_file: "patches/0005-spirv-cross-namespace-override.patch" | ||
base_path: "source_subfolder" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
find_package(diligent-core REQUIRED CONFIG) | ||
|
||
if(WIN32) | ||
set(FILE2STRING_PATH "${CONAN_BIN_DIRS_DILIGENT-CORE}/File2String.exe") | ||
else() | ||
set(FILE2STRING_PATH "${CONAN_BIN_DIRS_DILIGENT-CORE}/File2String") | ||
endif() | ||
|
||
set(FILE "${CONAN_RES_DIRS_DILIGENT}/HLSLDefinitions.fxh") | ||
set(FILE "${core_INCLUDE_DIR}/../res/HLSLDefinitions.fxh") | ||
set(CONVERTED_FILE "${PROJECT_BINARY_DIR}/HLSLDefinitions.h") | ||
|
||
add_custom_command(OUTPUT ${CONVERTED_FILE} | ||
COMMAND ${FILE2STRING_PATH} ${FILE} ${CONVERTED_FILE} | ||
COMMAND File2String ${FILE} ${CONVERTED_FILE} | ||
MAIN_DEPENDENCY ${FILE} # the primary input source file to the command | ||
COMMENT "Processing shader ${FILE}" | ||
VERBATIM) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) | ||
target_link_libraries(${PROJECT_NAME} diligent-core::diligent-core) | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
from conans import ConanFile, CMake, tools | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import CMake, cmake_layout | ||
import os | ||
from conan.tools.build import cross_building | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindir, "test_package") | ||
self.run(bin_path, env="conanrun") |
Uh oh!
There was an error while loading. Please reload this page.