1# Copyright 2020 The Dawn Authors
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
15add_library(dawn_common STATIC ${DAWN_DUMMY_FILE})
16target_sources(dawn_common PRIVATE
17    "Alloc.h"
18    "Assert.cpp"
19    "Assert.h"
20    "BitSetIterator.h"
21    "Compiler.h"
22    "ConcurrentCache.h"
23    "Constants.h"
24    "CoreFoundationRef.h"
25    "DynamicLib.cpp"
26    "DynamicLib.h"
27    "GPUInfo.cpp"
28    "GPUInfo.h"
29    "HashUtils.h"
30    "IOKitRef.h"
31    "LinkedList.h"
32    "Log.cpp"
33    "Log.h"
34    "Math.cpp"
35    "Math.h"
36    "NSRef.h"
37    "NonCopyable.h"
38    "PlacementAllocated.h"
39    "Platform.h"
40    "Preprocessor.h"
41    "RefBase.h"
42    "RefCounted.cpp"
43    "RefCounted.h"
44    "Result.cpp"
45    "Result.h"
46    "SerialMap.h"
47    "SerialQueue.h"
48    "SerialStorage.h"
49    "SlabAllocator.cpp"
50    "SlabAllocator.h"
51    "StackContainer.h"
52    "SwapChainUtils.h"
53    "SystemUtils.cpp"
54    "SystemUtils.h"
55    "TypeTraits.h"
56    "TypedInteger.h"
57    "UnderlyingType.h"
58    "ityp_array.h"
59    "ityp_bitset.h"
60    "ityp_span.h"
61    "ityp_stack_vec.h"
62    "ityp_vector.h"
63    "vulkan_platform.h"
64    "xlib_with_undefs.h"
65)
66
67if (WIN32)
68    target_sources(dawn_common PRIVATE
69        "WindowsUtils.cpp"
70        "WindowsUtils.h"
71        "windows_with_undefs.h"
72    )
73elseif(APPLE)
74    target_sources(dawn_common PRIVATE
75        "SystemUtils_mac.mm"
76    )
77endif()
78
79target_link_libraries(dawn_common PUBLIC dawncpp_headers PRIVATE dawn_internal_config)
80
81# TODO Android Log support
82# TODO Vulkan headers support
83