CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/ext/SPIRV-Cross-build/CMakeLists.txt
Views: 1401
1
# Copyright 2016 Google Inc.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
# http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
cmake_minimum_required(VERSION 3.0)
16
project(SPIRV-Cross)
17
enable_testing()
18
19
option(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS "Instead of throwing exceptions assert" ON)
20
21
set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../SPIRV-Cross")
22
23
add_library(spirv-cross-core STATIC
24
${SRCDIR}/GLSL.std.450.h
25
${SRCDIR}/spirv_common.hpp
26
${SRCDIR}/spirv.hpp
27
${SRCDIR}/spirv_cross.hpp
28
${SRCDIR}/spirv_cross.cpp
29
${SRCDIR}/spirv_cross_containers.hpp
30
${SRCDIR}/spirv_cross_error_handling.hpp
31
${SRCDIR}/spirv_cross_util.hpp
32
${SRCDIR}/spirv_cross_util.cpp
33
${SRCDIR}/spirv_cfg.hpp
34
${SRCDIR}/spirv_cfg.cpp
35
${SRCDIR}/spirv_cross_parsed_ir.hpp
36
${SRCDIR}/spirv_cross_parsed_ir.cpp
37
${SRCDIR}/spirv_parser.hpp
38
${SRCDIR}/spirv_parser.cpp)
39
40
add_library(spirv-cross-glsl STATIC
41
${SRCDIR}/spirv_glsl.cpp
42
${SRCDIR}/spirv_glsl.hpp)
43
44
add_library(spirv-cross-cpp STATIC
45
${SRCDIR}/spirv_cpp.hpp
46
${SRCDIR}/spirv_cpp.cpp)
47
48
add_library(spirv-cross-msl STATIC
49
${SRCDIR}/spirv_msl.hpp
50
${SRCDIR}/spirv_msl.cpp)
51
52
add_library(spirv-cross-hlsl STATIC
53
${SRCDIR}/spirv_hlsl.hpp
54
${SRCDIR}/spirv_hlsl.cpp)
55
56
#add_executable(spirv-cross main.cpp)
57
#target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-cpp spirv-cross-msl spirv-cross-hlsl spirv-cross-core)
58
target_link_libraries(spirv-cross-glsl spirv-cross-core)
59
target_link_libraries(spirv-cross-msl spirv-cross-glsl)
60
target_link_libraries(spirv-cross-cpp spirv-cross-glsl)
61
target_link_libraries(spirv-cross-hlsl spirv-cross-glsl)
62
target_include_directories(spirv-cross-core PUBLIC ${SRCDIR})
63
64
set(spirv-compiler-options "")
65
set(spirv-compiler-defines "")
66
67
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
68
set(spirv-compiler-defines ${spirv-compiler-defines} SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
69
endif()
70
71
# To specify special debug or optimization options, use
72
# -DCMAKE_CXX_COMPILE_FLAGS
73
# However, we require the C++11 dialect.
74
if (NOT "${MSVC}")
75
set(spirv-compiler-options ${spirv-compiler-options})
76
set(spirv-compiler-defines ${spirv-compiler-defines} __STDC_LIMIT_MACROS)
77
78
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
79
set(spirv-compiler-options ${spirv-compiler-options} -fno-exceptions)
80
endif()
81
endif()
82
83
target_compile_options(spirv-cross-core PRIVATE ${spirv-compiler-options})
84
target_compile_options(spirv-cross-glsl PRIVATE ${spirv-compiler-options})
85
target_compile_options(spirv-cross-msl PRIVATE ${spirv-compiler-options})
86
target_compile_options(spirv-cross-cpp PRIVATE ${spirv-compiler-options})
87
target_compile_options(spirv-cross-hlsl PRIVATE ${spirv-compiler-options})
88
target_compile_definitions(spirv-cross-core PRIVATE ${spirv-compiler-defines})
89
target_compile_definitions(spirv-cross-glsl PRIVATE ${spirv-compiler-defines})
90
target_compile_definitions(spirv-cross-msl PRIVATE ${spirv-compiler-defines})
91
target_compile_definitions(spirv-cross-cpp PRIVATE ${spirv-compiler-defines})
92
target_compile_definitions(spirv-cross-hlsl PRIVATE ${spirv-compiler-defines})
93
94