• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The SwiftShader 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
15set(ROOT_PROJECT_COMPILE_OPTIONS
16    ${SWIFTSHADER_COMPILE_OPTIONS}
17    ${WARNINGS_AS_ERRORS}
18)
19
20set(ASTC_ENCODER_SRC_FILES
21    Source/astc_block_sizes2.cpp
22    Source/astc_codec_internals.h
23    Source/astc_color_unquantize.cpp
24    Source/astc_decompress_symbolic.cpp
25    Source/astc_image_load_store.cpp
26    Source/astc_integer_sequence.cpp
27    Source/astc_mathlib.cpp
28    Source/astc_mathlib.h
29    Source/astc_mathlib_softfloat.cpp
30    Source/astc_partition_tables.cpp
31    Source/astc_quantization.cpp
32    Source/astc_symbolic_physical.cpp
33    Source/astc_weight_quant_xfer_tables.cpp
34)
35
36add_library(astc-encoder STATIC EXCLUDE_FROM_ALL
37    ${ASTC_ENCODER_SRC_FILES}
38)
39
40set_target_properties(astc-encoder PROPERTIES
41    POSITION_INDEPENDENT_CODE 1
42)
43
44target_include_directories(astc-encoder
45    PUBLIC
46        "Source"
47)
48
49target_compile_definitions(astc-encoder
50    PUBLIC
51        # TODO: Remove SWIFTSHADER from the name
52        "SWIFTSHADER_ENABLE_ASTC"
53)
54
55target_compile_options(astc-encoder
56    PRIVATE
57        ${ROOT_PROJECT_COMPILE_OPTIONS}
58)
59