Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/shaderc
Path: blob/main/libshaderc_util/CMakeLists.txt
1560 views
1
# Copyright 2020 The Shaderc Authors. All rights reserved.
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
project(libshaderc_util)
16
17
add_library(shaderc_util STATIC
18
include/libshaderc_util/counting_includer.h
19
include/libshaderc_util/file_finder.h
20
include/libshaderc_util/format.h
21
include/libshaderc_util/io_shaderc.h
22
include/libshaderc_util/mutex.h
23
include/libshaderc_util/message.h
24
include/libshaderc_util/resources.h
25
include/libshaderc_util/spirv_tools_wrapper.h
26
include/libshaderc_util/string_piece.h
27
include/libshaderc_util/universal_unistd.h
28
include/libshaderc_util/version_profile.h
29
src/args.cc
30
src/compiler.cc
31
src/file_finder.cc
32
src/io_shaderc.cc
33
src/message.cc
34
src/resources.cc
35
src/shader_stage.cc
36
src/spirv_tools_wrapper.cc
37
src/version_profile.cc
38
)
39
40
shaderc_default_compile_options(shaderc_util)
41
target_include_directories(shaderc_util
42
PUBLIC include PRIVATE ${glslang_SOURCE_DIR})
43
# We use parts of Glslang's HLSL compilation interface, which
44
# now requires this preprocessor definition.
45
add_definitions(-DENABLE_HLSL)
46
47
find_package(Threads)
48
target_link_libraries(shaderc_util PRIVATE
49
glslang SPIRV
50
SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
51
52
shaderc_add_tests(
53
TEST_PREFIX shaderc_util
54
LINK_LIBS shaderc_util
55
TEST_NAMES
56
counting_includer
57
string_piece
58
format
59
file_finder
60
io_shaderc
61
message
62
mutex
63
version_profile)
64
65
if(${SHADERC_ENABLE_TESTS})
66
target_include_directories(shaderc_util_counting_includer_test
67
PRIVATE ${glslang_SOURCE_DIR})
68
target_include_directories(shaderc_util_version_profile_test
69
PRIVATE ${glslang_SOURCE_DIR})
70
endif()
71
72
shaderc_add_tests(
73
TEST_PREFIX shaderc_util
74
LINK_LIBS shaderc_util
75
INCLUDE_DIRS
76
${glslang_SOURCE_DIR}
77
${spirv-tools_SOURCE_DIR}/include
78
TEST_NAMES
79
compiler)
80
81
# This target copies content of testdata into the build directory.
82
add_custom_target(testdata COMMAND
83
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/testdata/copy-to-build.cmake
84
COMMENT "Copy testdata into build directory")
85
86
if(${SHADERC_ENABLE_TESTS})
87
add_dependencies(shaderc_util_file_finder_test testdata)
88
add_dependencies(shaderc_util_io_shaderc_test testdata)
89
endif()
90
91