xref: /aosp_15_r20/external/swiftshader/tests/MathUnitTests/CMakeLists.txt (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
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)
18
19set(ROOT_PROJECT_LINK_LIBRARIES
20    ${OS_LIBS}
21    ${SWIFTSHADER_LIBS}
22)
23
24set(MATH_UNIT_TESTS_SRC_FILES
25    main.cpp
26    unittests.cpp
27)
28
29add_executable(math-unittests
30    ${MATH_UNIT_TESTS_SRC_FILES}
31)
32
33set_target_properties(math-unittests PROPERTIES
34    FOLDER "Tests"
35    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
36)
37
38target_compile_options(math-unittests
39    PRIVATE
40        ${ROOT_PROJECT_COMPILE_OPTIONS}
41)
42
43target_link_options(math-unittests
44    PRIVATE
45        ${SWIFTSHADER_LINK_FLAGS}
46)
47
48target_link_libraries(math-unittests
49    PRIVATE
50        vk_system
51        gtest
52        gmock
53        ${ROOT_PROJECT_LINK_LIBRARIES}
54)
55