Spirv-Cross
This commit is contained in:
12
spirv-cross/all/test_package/CMakeLists.txt
Normal file
12
spirv-cross/all/test_package/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package LANGUAGES C)
|
||||
|
||||
# FIXME: this is not the official way to find spirv-cross components
|
||||
find_package(spirv-cross REQUIRED CONFIG)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.c)
|
||||
if(TARGET spirv-cross-c)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c)
|
||||
elseif(TARGET spirv-cross-c-shared)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c-shared)
|
||||
endif()
|
||||
26
spirv-cross/all/test_package/conanfile.py
Normal file
26
spirv-cross/all/test_package/conanfile.py
Normal 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")
|
||||
15
spirv-cross/all/test_package/test_package.c
Normal file
15
spirv-cross/all/test_package/test_package.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <spirv_cross_c.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
spvc_context context;
|
||||
spvc_context_create(&context);
|
||||
spvc_context_destroy(context);
|
||||
|
||||
unsigned major, minor, patch;
|
||||
spvc_get_version(&major, &minor, &patch);
|
||||
printf("SPIRV-Cross: C API version %u.%u.%u\n", major, minor, patch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user