• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 The Khronos Group Inc.
3 * Copyright (c) 2021-2022 Valve Corporation
4 * Copyright (c) 2021-2022 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and/or associated documentation files (the "Materials"), to
8 * deal in the Materials without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Materials, and to permit persons to whom the Materials are
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice(s) and this permission notice shall be included in
14 * all copies or substantial portions of the Materials.
15 *
16 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 *
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
23 * USE OR OTHER DEALINGS IN THE MATERIALS.
24 *
25 * Author: Charles Giessen <charles@lunarg.com>
26 */
27
28#pragma once
29#define FRAMEWORK_BUILD_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
30
31#define FRAMEWORK_VULKAN_LIBRARY_PATH "$<TARGET_FILE:vulkan>"
32
33#define SHIM_LIBRARY_NAME "$<TARGET_FILE:shim-library>"
34
35#define TEST_ICD_BUILD_LOCATION "$<TARGET_FILE_DIR:test_icd_export_none>"
36
37// TestICD Binaries
38#define TEST_ICD_PATH_EXPORT_NONE "$<TARGET_FILE:test_icd_export_none>"
39#define TEST_ICD_PATH_EXPORT_ICD_GIPA "$<TARGET_FILE:test_icd_export_icd_gipa>"
40#define TEST_ICD_PATH_EXPORT_NEGOTIATE_INTERFACE_VERSION "$<TARGET_FILE:test_icd_export_negotiate_interface_version>"
41
42#define TEST_ICD_PATH_VERSION_2 "$<TARGET_FILE:test_icd_version_2>"
43
44#define TEST_JSON_NAME_VERSION_2_UNICODE "\xf0\x9f\x8c\x8b"
45#define TEST_ICD_PATH_VERSION_2_UNICODE \
46    "$<TARGET_FILE_DIR:test_icd_version_2>/" TEST_JSON_NAME_VERSION_2_UNICODE "$<TARGET_FILE_SUFFIX:test_icd_version_2>"
47
48// assumes version 2 exports
49#define TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA "$<TARGET_FILE:test_icd_version_2_export_icd_gpdpa>"
50
51// Assumes version 2 exports
52#define TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES \
53    "$<TARGET_FILE:test_icd_version_2_export_icd_enumerate_adapter_physical_devices>"
54
55// All possible defines for v6
56#define TEST_ICD_PATH_VERSION_6 "$<TARGET_FILE:test_icd_version_6>"
57
58// TestLayer binaries
59#define TEST_LAYER_PATH_EXPORT_BASE "$<TARGET_FILE:test_layer_export_base>"
60#define TEST_LAYER_PATH_EXPORT_VERSION_0 "$<TARGET_FILE:test_layer_export_version_0>"
61#define TEST_LAYER_PATH_EXPORT_VERSION_1 "$<TARGET_FILE:test_layer_export_version_1>"
62#define TEST_LAYER_PATH_EXPORT_VERSION_2 "$<TARGET_FILE:test_layer_export_version_2>"
63#define TEST_LAYER_WRAP_OBJECTS "$<TARGET_FILE:test_layer_wrap_objects>"
64#define TEST_LAYER_WRAP_OBJECTS_1 "$<TARGET_FILE:test_layer_wrap_objects_1>"
65#define TEST_LAYER_WRAP_OBJECTS_2 "$<TARGET_FILE:test_layer_wrap_objects_2>"
66#define TEST_LAYER_WRAP_OBJECTS_3 "$<TARGET_FILE:test_layer_wrap_objects_3>"
67
68// Dummy Binaries
69#if _WIN32 || _WIN64
70#define DUMMY_BINARY_WINDOWS_64 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/dummy_library_pe_64.dll"
71#define DUMMY_BINARY_WINDOWS_32 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/dummy_library_pe_32.dll"
72#define BAD_DUMMY_BINARY_WINDOWS_64 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/libdummy_library_elf_64.dll"
73#define BAD_DUMMY_BINARY_WINDOWS_32 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/libdummy_library_elf_32.dll"
74#endif
75#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
76#define DUMMY_BINARY_LINUX_64 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/libdummy_library_elf_64.so"
77#define DUMMY_BINARY_LINUX_32 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/libdummy_library_elf_32.so"
78#define BAD_DUMMY_BINARY_LINUX_64 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/dummy_library_pe_64.so"
79#define BAD_DUMMY_BINARY_LINUX_32 "${CMAKE_CURRENT_SOURCE_DIR}/data/binaries/dummy_library_pe_32.so"
80#endif
81
82// Convenience macro so that tests don't need to write a bunch of platform defines
83#if _WIN32 || _WIN64
84#if _WIN64
85#define CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE DUMMY_BINARY_WINDOWS_32
86#define CURRENT_PLATFORM_DUMMY_BINARY_BAD BAD_DUMMY_BINARY_WINDOWS_64
87#else
88#define CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE DUMMY_BINARY_WINDOWS_64
89#define CURRENT_PLATFORM_DUMMY_BINARY_BAD BAD_DUMMY_BINARY_WINDOWS_32
90#endif
91#endif
92#if defined(__linux__)
93#if __x86_64__ || __ppc64__
94#define CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE DUMMY_BINARY_LINUX_32
95#define CURRENT_PLATFORM_DUMMY_BINARY_BAD BAD_DUMMY_BINARY_LINUX_64
96#else
97#define CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE DUMMY_BINARY_LINUX_64
98#define CURRENT_PLATFORM_DUMMY_BINARY_BAD BAD_DUMMY_BINARY_LINUX_32
99#endif
100#endif
101// Apple doesn't have 32 bit but this should allow tests to run as if it was supported
102#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
103#define CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE DUMMY_BINARY_LINUX_32
104#define CURRENT_PLATFORM_DUMMY_BINARY_BAD BAD_DUMMY_BINARY_LINUX_64
105#endif
106