summarylogtreecommitdiffstats
path: root/optional-spirv-tools.patch
blob: 343d20c646817f492e71fc36900d99cc81b2f981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# HG changeset patch
# User Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
# Date 1587252594 -7200
#      Sun Apr 19 01:29:54 2020 +0200
# Node ID 4d79c930f9714fc8a03addf35ec1a9e1524da49f
# Parent  01fea3855ffb0f7536ac5420d449a2adcb6f36f6
Make Spirv-Tools optional

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ OPTION(COMPILER_SUPPORT "Build MojoShade
 OPTION(FLIP_VIEWPORT "Build MojoShader with the ability to flip the GL viewport" OFF)
 OPTION(DEPTH_CLIPPING "Build MojoShader with the ability to simulate [0, 1] depth clipping" OFF)
 OPTION(XNA4_VERTEXTEXTURE "Build MojoShader with XNA4 vertex texturing behavior" OFF)
+OPTION(ENABLE_SPIRV_TOOLS "TODO" ON)
 
 INCLUDE_DIRECTORIES(.)
 
@@ -225,18 +226,21 @@ IF(COMPILER_SUPPORT)
     ENDIF(SDL2)
 ENDIF(COMPILER_SUPPORT)
 
-FIND_PATH(SPIRV_TOOLS_INCLUDE_DIR "spirv-tools/libspirv.h" PATH_SUFFIXES "include")
-FIND_LIBRARY(SPIRV_TOOLS_LIBRARY NAMES SPIRV-Tools-shared)
-IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
-    INCLUDE_DIRECTORIES(${SPIRV_TOOLS_INCLUDE_DIR})
-    ADD_DEFINITIONS(-DMOJOSHADER_HAS_SPIRV_TOOLS)
-ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+IF(ENABLE_SPIRV_TOOLS)
+    FIND_PATH(SPIRV_TOOLS_INCLUDE_DIR "spirv-tools/libspirv.h" PATH_SUFFIXES "include")
+    FIND_LIBRARY(SPIRV_TOOLS_LIBRARY NAMES SPIRV-Tools-shared)
+    IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+        INCLUDE_DIRECTORIES(${SPIRV_TOOLS_INCLUDE_DIR})
+        ADD_DEFINITIONS(-DMOJOSHADER_HAS_SPIRV_TOOLS)
+    ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
 
-ADD_EXECUTABLE(testparse utils/testparse.c)
-TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
-IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
-    TARGET_LINK_LIBRARIES(testparse ${SPIRV_TOOLS_LIBRARY})
-ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+    ADD_EXECUTABLE(testparse utils/testparse.c)
+    TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
+    IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+        TARGET_LINK_LIBRARIES(testparse ${SPIRV_TOOLS_LIBRARY})
+    ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+ENDIF(ENABLE_SPIRV_TOOLS)
+
 ADD_EXECUTABLE(testoutput utils/testoutput.c)
 TARGET_LINK_LIBRARIES(testoutput mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
 IF(COMPILER_SUPPORT)