Debian Codegraph @

tests/framework/util/CMakeLists.txt

raw
1 # ~~~
2 # Copyright (c) 2021 Valve Corporation
3 # Copyright (c) 2021 LunarG, Inc.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ~~~
17
18 add_library(testing_framework_util STATIC
19 builder_defines.h
20 dispatch_table.cpp
21 dispatch_table.h
22 dispatchable_handle.h
23 dynamic_library_wrapper.cpp
24 dynamic_library_wrapper.h
25 env_var_wrapper.cpp
26 env_var_wrapper.h
27 equality_helpers.cpp
28 equality_helpers.h
29 folder_manager.cpp
30 folder_manager.h
31 functions.h
32 get_executable_path.cpp
33 get_executable_path.h
34 json_writer.cpp
35 json_writer.h
36 manifest_builders.cpp
37 manifest_builders.h
38 platform_wsi.cpp
39 platform_wsi.h
40 test_defines.h
41 vulkan_object_wrappers.cpp
42 vulkan_object_wrappers.h
43 wide_char_handling.cpp
44 wide_char_handling.h
45 )
46 target_link_libraries(testing_framework_util PUBLIC loader_common_options Vulkan::Headers gtest)
47
48 if(UNIX OR APPLE)
49 target_link_libraries(testing_framework_util PUBLIC ${CMAKE_DL_LIBS})
50 endif()
51
52 if(UNIX)
53 target_compile_options(testing_framework_util PUBLIC -fPIC)
54 endif()
55 # Gives access to all headers in this folder, the framework folder, the framework binary folder, and the loader/generated folder
56 target_include_directories(testing_framework_util
57 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/.." "${CMAKE_CURRENT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}")
58
59 if (UNIX)
60 if (LOADER_ENABLE_ADDRESS_SANITIZER)
61 target_compile_options(testing_framework_util PUBLIC -fsanitize=address,undefined)
62 target_link_options(testing_framework_util PUBLIC -fsanitize=address,undefined)
63 endif()
64 if (LOADER_ENABLE_THREAD_SANITIZER)
65 target_compile_options(testing_framework_util PUBLIC -fsanitize=thread)
66 target_link_options(testing_framework_util PUBLIC -fsanitize=thread)
67 target_compile_options(gtest PUBLIC -fsanitize=thread)
68 target_link_options(gtest PUBLIC -fsanitize=thread)
69 endif()
70 endif()
71
72 if (MSVC)
73 # silence hidden class member warnings in test framework
74 target_compile_options(testing_framework_util PUBLIC /wd4458)
75 # Make sure exception handling is enabled for the test framework
76 target_compile_options(testing_framework_util PUBLIC /EHsc)
77 endif()
78
79 # Add a compiler definition for the path to framework_config.h with the correct config
80 target_compile_definitions(testing_framework_util PUBLIC FRAMEWORK_CONFIG_HEADER="${FRAMEWORK_CONFIG_HEADER_PATH}")
81
82 if (APPLE_STATIC_LOADER)
83 target_compile_definitions(testing_framework_util PUBLIC "APPLE_STATIC_LOADER=1")
84 target_link_libraries(testing_framework_util PRIVATE vulkan)
85 endif()