yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
e70645c4
main
1# Copyright (C) 2025 The Khronos Group Inc. 2# 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 9# Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 12# Redistributions in binary form must reproduce the above 13# copyright notice, this list of conditions and the following 14# disclaimer in the documentation and/or other materials provided 15# with the distribution. 16# 17# Neither the name of The Khronos Group Inc. nor the names of its 18# contributors may be used to endorse or promote products derived 19# from this software without specific prior written permission. 20# 21# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32# POSSIBILITY OF SUCH DAMAGE. 33cmake_minimum_required ( VERSION 3.22.1 ) 34 35# NOTE: The whole point of this file is to test what the client will 36# see when they install glslang via a package manager. 37project ( FP_TEST LANGUAGES C CXX ) 38 39# Assume the user install here to simplify CI 40# It also makes local testing easier. 41list ( APPEND CMAKE_PREFIX_PATH " ${ PROJECT_SOURCE_DIR } /../../build/install" ) 42find_package ( glslang REQUIRED CONFIG ) 43 44if ( NOT DEFINED glslang_VERSION) 45message ( FATAL_ERROR "glslang_VERSION not defined!" ) 46endif () 47message ( STATUS "glslang_VERSION = ${ glslang_VERSION } " ) 48 49get_target_property ( target_type glslang::glslang TYPE ) 50message ( STATUS "glslang::glslang is ${ target_type } " ) 51 52add_executable ( example example.c ) 53target_link_libraries ( example PRIVATE 54glslang::glslang 55glslang::glslang-default-resource-limits 56) 57 58if ( NOT TARGET glslang::glslang-standalone) 59message ( FATAL_ERROR "glslang::glslang-standalone does not exist!" ) 60endif () 61 62if ( target_typeSTREQUAL STATIC_LIBRARY) 63# When these stub libraries are removed from the future. Simply remove this code. 64# For now it ensures backcompat is preserved. 65add_library ( stub STATIC stub.cpp ) 66target_link_libraries ( example PRIVATE 67glslang::GenericCodeGen 68glslang::MachineIndependent 69glslang::OSDependent 70glslang::SPIRV 71) 72 73# Ensure these executables run without issue 74add_custom_target ( test-executables ALL 75COMMAND glslang::glslang-standalone --version 76) 77endif ()