2016-03-19 21:13:06 +00:00
# Copyright 2016 Google Inc.
#
# 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.
cmake_minimum_required ( VERSION 2.8 )
2019-02-12 10:11:29 +00:00
set ( CMAKE_CXX_STANDARD 11 )
2019-03-04 10:13:41 +00:00
project ( SPIRV-Cross LANGUAGES CXX C )
2016-03-19 21:13:06 +00:00
enable_testing ( )
2016-12-15 19:46:10 +00:00
option ( SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS "Instead of throwing exceptions assert" OFF )
2019-02-12 10:11:29 +00:00
option ( SPIRV_CROSS_SHARED "Build the C API as a single shared library." OFF )
option ( SPIRV_CROSS_STATIC "Build the C and C++ API as static libraries." ON )
option ( SPIRV_CROSS_CLI "Build the CLI binary. Requires SPIRV_CROSS_STATIC." ON )
2019-03-07 09:22:58 +00:00
option ( SPIRV_CROSS_ENABLE_TESTS "Enable SPIRV-Cross tests." ON )
2016-12-12 21:33:22 +00:00
2019-03-05 09:11:04 +00:00
option ( SPIRV_CROSS_SANITIZE_ADDRESS "Sanitize address" OFF )
2019-03-05 10:15:08 +00:00
option ( SPIRV_CROSS_SANITIZE_MEMORY "Sanitize memory" OFF )
2019-03-05 09:11:04 +00:00
option ( SPIRV_CROSS_SANITIZE_THREADS "Sanitize threads" OFF )
2019-03-05 10:15:08 +00:00
option ( SPIRV_CROSS_SANITIZE_UNDEFINED "Sanitize undefined" OFF )
2019-03-05 09:11:04 +00:00
2016-03-19 21:13:06 +00:00
if ( ${ CMAKE_GENERATOR } MATCHES "Makefile" )
2019-02-12 10:11:29 +00:00
if ( ${ CMAKE_CURRENT_SOURCE_DIR } STREQUAL ${ CMAKE_CURRENT_BINARY_DIR } )
message ( FATAL_ERROR "Build out of tree to avoid overwriting Makefile" )
endif ( )
2016-03-19 21:13:06 +00:00
endif ( )
2016-12-15 19:46:10 +00:00
set ( spirv-compiler-options "" )
set ( spirv-compiler-defines "" )
2019-03-05 09:11:04 +00:00
set ( spirv-cross-link-flags "" )
2016-12-15 19:46:10 +00:00
if ( SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS )
2019-02-12 10:11:29 +00:00
set ( spirv-compiler-defines ${ spirv-compiler-defines } SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS )
2016-12-15 19:46:10 +00:00
endif ( )
2019-02-12 10:11:29 +00:00
if ( CMAKE_COMPILER_IS_GNUCXX OR ( ${ CMAKE_CXX_COMPILER_ID } MATCHES "Clang" ) )
set ( spirv-compiler-options ${ spirv-compiler-options } -Wall -Wextra -Werror -Wshadow )
2016-12-12 21:33:22 +00:00
2019-03-05 09:11:04 +00:00
if ( SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS )
2019-02-12 10:11:29 +00:00
set ( spirv-compiler-options ${ spirv-compiler-options } -fno-exceptions )
endif ( )
2019-03-05 09:11:04 +00:00
if ( SPIRV_CROSS_SANITIZE_ADDRESS )
set ( spirv-compiler-options ${ spirv-compiler-options } -fsanitize=address )
set ( spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=address" )
endif ( )
2019-03-05 10:15:08 +00:00
if ( SPIRV_CROSS_SANITIZE_UNDEFINED )
set ( spirv-compiler-options ${ spirv-compiler-options } -fsanitize=undefined )
set ( spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=undefined" )
endif ( )
if ( SPIRV_CROSS_SANITIZE_MEMORY )
set ( spirv-compiler-options ${ spirv-compiler-options } -fsanitize=memory )
set ( spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=memory" )
endif ( )
2019-03-05 09:11:04 +00:00
if ( SPIRV_CROSS_SANITIZE_THREADS )
set ( spirv-compiler-options ${ spirv-compiler-options } -fsanitize=thread )
set ( spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=thread" )
endif ( )
2019-02-12 10:11:29 +00:00
elseif ( MSVC )
set ( spirv-compiler-options ${ spirv-compiler-options } /wd4267 )
2016-12-12 21:33:22 +00:00
endif ( )
2016-03-19 21:13:06 +00:00
2017-01-24 00:49:16 +00:00
macro ( extract_headers out_abs file_list )
2019-02-12 10:11:29 +00:00
set ( ${ out_abs } ) # absolute paths
foreach ( _a ${ file_list } )
# get_filename_component only returns the longest extension, so use a regex
string ( REGEX REPLACE ".*\\.(h|hpp)" "\\1" ext ${ _a } )
# For shared library, we are only interested in the C header.
if ( SPIRV_CROSS_STATIC )
if ( ( "${ext}" STREQUAL "h" ) OR ( "${ext}" STREQUAL "hpp" ) )
list ( APPEND ${ out_abs } "${_a}" )
endif ( )
else ( )
if ( "${ext}" STREQUAL "h" )
list ( APPEND ${ out_abs } "${_a}" )
endif ( )
endif ( )
endforeach ( )
2017-01-24 00:49:16 +00:00
endmacro ( )
macro ( spirv_cross_add_library name config_name )
2019-02-12 10:11:29 +00:00
add_library ( ${ name } ${ ARGN } )
extract_headers ( hdrs "${ARGN}" )
target_include_directories ( ${ name } PUBLIC
$ < B U I L D _ I N T E R F A C E : $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } >
2019-03-04 10:33:01 +00:00
$ < I N S T A L L _ I N T E R F A C E : i n c l u d e / s p i r v _ c r o s s > )
2019-02-12 10:11:29 +00:00
set_target_properties ( ${ name } PROPERTIES
P U B L I C _ H E A D E R S " $ { h d r s } " )
target_compile_options ( ${ name } PRIVATE ${ spirv-compiler-options } )
target_compile_definitions ( ${ name } PRIVATE ${ spirv-compiler-defines } )
install ( TARGETS ${ name }
E X P O R T $ { c o n f i g _ n a m e } C o n f i g
R U N T I M E D E S T I N A T I O N b i n
L I B R A R Y D E S T I N A T I O N l i b
A R C H I V E D E S T I N A T I O N l i b
P U B L I C _ H E A D E R D E S T I N A T I O N i n c l u d e / s p i r v _ c r o s s )
install ( FILES ${ hdrs } DESTINATION include/spirv_cross )
install ( EXPORT ${ config_name } Config DESTINATION share/ ${ config_name } /cmake )
export ( TARGETS ${ name } FILE ${ config_name } Config.cmake )
2017-01-24 00:49:16 +00:00
endmacro ( )
2019-02-12 10:11:29 +00:00
set ( spirv-cross-core-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / G L S L . s t d . 4 5 0 . h
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c o m m o n . h p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v . h p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s . h p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ p a r s e r . h p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ p a r s e r . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s _ p a r s e d _ i r . h p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s _ p a r s e d _ i r . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c f g . h p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c f g . c p p )
set ( spirv-cross-c-sources
s p i r v . h
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s _ c . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s _ c . h )
set ( spirv-cross-glsl-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ g l s l . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ g l s l . h p p )
set ( spirv-cross-cpp-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c p p . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c p p . h p p )
set ( spirv-cross-msl-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ m s l . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ m s l . h p p )
set ( spirv-cross-hlsl-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ h l s l . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ h l s l . h p p )
set ( spirv-cross-reflect-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ r e f l e c t . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ r e f l e c t . h p p )
set ( spirv-cross-util-sources
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s _ u t i l . c p p
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s p i r v _ c r o s s _ u t i l . h p p )
if ( SPIRV_CROSS_STATIC )
spirv_cross_add_library ( spirv-cross-core spirv_cross_core STATIC
$ { s p i r v - c r o s s - c o r e - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-c spirv_cross_c STATIC
$ { s p i r v - c r o s s - c - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-glsl spirv_cross_glsl STATIC
$ { s p i r v - c r o s s - g l s l - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-cpp spirv_cross_cpp STATIC
$ { s p i r v - c r o s s - c p p - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-reflect spirv_cross_reflect STATIC
$ { s p i r v - c r o s s - r e f l e c t - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-msl spirv_cross_msl STATIC
$ { s p i r v - c r o s s - m s l - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-hlsl spirv_cross_hlsl STATIC
$ { s p i r v - c r o s s - h l s l - s o u r c e s } )
spirv_cross_add_library ( spirv-cross-util spirv_cross_util STATIC
$ { s p i r v - c r o s s - u t i l - s o u r c e s } )
target_link_libraries ( spirv-cross-util PRIVATE spirv-cross-core )
target_link_libraries ( spirv-cross-glsl PRIVATE spirv-cross-core )
target_link_libraries ( spirv-cross-msl PRIVATE spirv-cross-glsl )
target_link_libraries ( spirv-cross-hlsl PRIVATE spirv-cross-glsl )
target_link_libraries ( spirv-cross-cpp PRIVATE spirv-cross-glsl )
2019-03-04 10:13:41 +00:00
target_link_libraries ( spirv-cross-c PRIVATE
s p i r v - c r o s s - c o r e
s p i r v - c r o s s - g l s l
s p i r v - c r o s s - h l s l
s p i r v - c r o s s - m s l
s p i r v - c r o s s - c p p
s p i r v - c r o s s - r e f l e c t )
2019-02-12 10:11:29 +00:00
endif ( )
if ( SPIRV_CROSS_SHARED )
set ( spirv-cross-abi-major 0 )
2019-03-14 09:29:34 +00:00
set ( spirv-cross-abi-minor 2 )
2019-02-12 10:11:29 +00:00
set ( spirv-cross-abi-patch 0 )
set ( SPIRV_CROSS_VERSION ${ spirv-cross-abi-major } . ${ spirv-cross-abi-minor } . ${ spirv-cross-abi-patch } )
set ( SPIRV_CROSS_INSTALL_LIB_DIR ${ CMAKE_INSTALL_PREFIX } /lib )
2019-03-04 10:33:01 +00:00
set ( SPIRV_CROSS_INSTALL_INC_DIR ${ CMAKE_INSTALL_PREFIX } /include/spirv_cross )
2019-02-12 10:11:29 +00:00
configure_file (
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p k g - c o n f i g / s p i r v - c r o s s - c - s h a r e d . p c . i n
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s p i r v - c r o s s - c - s h a r e d . p c @ O N L Y )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /spirv-cross-c-shared.pc DESTINATION ${ CMAKE_INSTALL_PREFIX } /share/pkgconfig )
spirv_cross_add_library ( spirv-cross-c-shared spirv_cross_c_shared SHARED
$ { s p i r v - c r o s s - c o r e - s o u r c e s }
$ { s p i r v - c r o s s - g l s l - s o u r c e s }
$ { s p i r v - c r o s s - c p p - s o u r c e s }
$ { s p i r v - c r o s s - r e f l e c t - s o u r c e s }
$ { s p i r v - c r o s s - m s l - s o u r c e s }
$ { s p i r v - c r o s s - h l s l - s o u r c e s }
$ { s p i r v - c r o s s - c - s o u r c e s } )
if ( CMAKE_COMPILER_IS_GNUCXX OR ( ${ CMAKE_CXX_COMPILER_ID } MATCHES "Clang" ) )
# Only export the C API.
target_compile_options ( spirv-cross-c-shared PRIVATE -fvisibility=hidden )
if ( NOT APPLE )
2019-03-05 09:11:04 +00:00
set_target_properties ( spirv-cross-c-shared PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}" )
2019-02-12 10:11:29 +00:00
endif ( )
endif ( )
2019-03-04 09:08:31 +00:00
target_compile_definitions ( spirv-cross-c-shared PRIVATE SPVC_EXPORT_SYMBOLS )
2019-02-12 10:11:29 +00:00
set_target_properties ( spirv-cross-c-shared PROPERTIES
V E R S I O N $ { S P I R V _ C R O S S _ V E R S I O N }
S O V E R S I O N $ { s p i r v - c r o s s - a b i - m a j o r } )
endif ( )
if ( SPIRV_CROSS_CLI )
if ( NOT SPIRV_CROSS_STATIC )
message ( FATAL_ERROR "Must build static libraries if building CLI." )
endif ( )
add_executable ( spirv-cross main.cpp )
target_compile_options ( spirv-cross PRIVATE ${ spirv-compiler-options } )
target_compile_definitions ( spirv-cross PRIVATE ${ spirv-compiler-defines } )
2019-03-05 10:15:08 +00:00
set_target_properties ( spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}" )
2019-02-12 10:11:29 +00:00
install ( TARGETS spirv-cross RUNTIME DESTINATION bin )
target_link_libraries ( spirv-cross PRIVATE
s p i r v - c r o s s - g l s l
s p i r v - c r o s s - h l s l
s p i r v - c r o s s - c p p
s p i r v - c r o s s - r e f l e c t
s p i r v - c r o s s - m s l
s p i r v - c r o s s - u t i l
s p i r v - c r o s s - c o r e )
2017-01-24 00:49:16 +00:00
2019-03-07 09:22:58 +00:00
if ( SPIRV_CROSS_ENABLE_TESTS )
# Set up tests, using only the simplest modes of the test_shaders
# script. You have to invoke the script manually to:
# - Update the reference files
# - Get cycle counts from malisc
# - Keep failing outputs
find_package ( PythonInterp )
find_program ( spirv-cross-glslang NAMES glslangValidator
P A T H S $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e x t e r n a l / g l s l a n g - b u i l d / o u t p u t / b i n
N O _ D E F A U L T _ P A T H )
find_program ( spirv-cross-spirv-as NAMES spirv-as
P A T H S $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e x t e r n a l / s p i r v - t o o l s - b u i l d / o u t p u t / b i n
N O _ D E F A U L T _ P A T H )
find_program ( spirv-cross-spirv-val NAMES spirv-val
P A T H S $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e x t e r n a l / s p i r v - t o o l s - b u i l d / o u t p u t / b i n
N O _ D E F A U L T _ P A T H )
2019-03-07 11:36:16 +00:00
find_program ( spirv-cross-spirv-opt NAMES spirv-opt
P A T H S $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e x t e r n a l / s p i r v - t o o l s - b u i l d / o u t p u t / b i n
N O _ D E F A U L T _ P A T H )
2019-03-07 09:22:58 +00:00
2019-03-07 11:36:16 +00:00
if ( ( ${ spirv-cross-glslang } MATCHES "NOTFOUND" ) OR ( ${ spirv-cross-spirv-as } MATCHES "NOTFOUND" ) OR ( ${ spirv-cross-spirv-val } MATCHES "NOTFOUND" ) OR ( ${ spirv-cross-spirv-opt } MATCHES "NOTFOUND" ) )
2019-03-07 09:22:58 +00:00
set ( SPIRV_CROSS_ENABLE_TESTS OFF )
message ( "Could not find glslang or SPIRV-Tools build under external/. Run ./checkout_glslang_spirv_tools.sh and ./build_glslang_spirv_tools.sh. Testing will be disabled." )
else ( )
set ( SPIRV_CROSS_ENABLE_TESTS ON )
message ( "Found glslang and SPIRV-Tools. Enabling test suite." )
message ( "Found glslangValidator in: ${spirv-cross-glslang}." )
message ( "Found spirv-as in: ${spirv-cross-spirv-as}." )
message ( "Found spirv-val in: ${spirv-cross-spirv-val}." )
2019-03-07 11:36:16 +00:00
message ( "Found spirv-opt in: ${spirv-cross-spirv-opt}." )
2019-03-07 09:22:58 +00:00
endif ( )
2019-03-07 11:36:16 +00:00
set ( spirv-cross-externals
- - g l s l a n g " $ { s p i r v - c r o s s - g l s l a n g } "
- - s p i r v - a s " $ { s p i r v - c r o s s - s p i r v - a s } "
- - s p i r v - o p t " $ { s p i r v - c r o s s - s p i r v - o p t } "
- - s p i r v - v a l " $ { s p i r v - c r o s s - s p i r v - v a l } " )
2019-03-07 09:22:58 +00:00
if ( ${ PYTHONINTERP_FOUND } AND SPIRV_CROSS_ENABLE_TESTS )
if ( ${ PYTHON_VERSION_MAJOR } GREATER 2 )
add_executable ( spirv-cross-c-api-test tests-other/c_api_test.c )
target_link_libraries ( spirv-cross-c-api-test spirv-cross-c )
set_target_properties ( spirv-cross-c-api-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}" )
if ( CMAKE_COMPILER_IS_GNUCXX OR ( ${ CMAKE_CXX_COMPILER_ID } MATCHES "Clang" ) )
target_compile_options ( spirv-cross-c-api-test PRIVATE -std=c89 -Wall -Wextra )
endif ( )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-c-api-test
2019-03-07 09:22:58 +00:00
C O M M A N D $ < T A R G E T _ F I L E : s p i r v - c r o s s - c - a p i - t e s t > $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t s - o t h e r / c _ a p i _ t e s t . s p v )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-no-opt
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - n o - o p t
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-metal
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - m e t a l - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - m s l
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-metal-no-opt
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - m e t a l - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - m s l - n o - o p t
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-hlsl
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - h l s l - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - h l s l
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-hlsl-no-opt
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - h l s l - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - h l s l - n o - o p t
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-opt
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - o p t - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-metal-opt
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - m e t a l - - o p t - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - m s l
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-hlsl-opt
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - h l s l - - o p t - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - h l s l
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-07 11:36:16 +00:00
add_test ( NAME spirv-cross-test-reflection
2019-03-07 09:22:58 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t _ s h a d e r s . p y - - r e f l e c t - - p a r a l l e l
2019-03-07 11:36:16 +00:00
$ { s p i r v - c r o s s - e x t e r n a l s }
2019-03-07 09:22:58 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / s h a d e r s - r e f l e c t i o n
W O R K I N G _ D I R E C T O R Y $ < T A R G E T _ F I L E _ D I R : s p i r v - c r o s s > )
2019-03-04 10:13:41 +00:00
endif ( )
2019-03-07 09:22:58 +00:00
elseif ( NOT ${ PYTHONINTERP_FOUND } )
message ( WARNING "Testing disabled. Could not find python3. If you have python3 installed try running "
" c m a k e w i t h - D P Y T H O N _ E X E C U T A B L E : F I L E P A T H = / p a t h / t o / p y t h o n 3 t o h e l p i t f i n d t h e e x e c u t a b l e " )
2019-02-12 10:11:29 +00:00
endif ( )
endif ( )
2016-03-19 21:13:06 +00:00
endif ( )