1 # Platform port library
3 # Target file may define TCUTIL_PLATFORM_SRCS
4 if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
6 set(TCUTIL_PLATFORM_SRCS
7 win32/tcuWin32Platform.hpp
8 win32/tcuWin32Platform.cpp
9 win32/tcuWGLContextFactory.hpp
10 win32/tcuWGLContextFactory.cpp
14 win32/tcuWin32Window.cpp
15 win32/tcuWin32Window.hpp
16 win32/tcuWin32EGLNativeDisplayFactory.hpp
17 win32/tcuWin32EGLNativeDisplayFactory.cpp
18 win32/tcuWin32VulkanPlatform.hpp
19 win32/tcuWin32VulkanPlatform.cpp
22 elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND (DEQP_USE_X11 OR DEQP_USE_WAYLAND))
24 set(TCUTIL_PLATFORM_SRCS
27 lnx/tcuLnxPlatform.cpp
28 lnx/tcuLnxPlatform.hpp
29 lnx/tcuLnxEglPlatform.hpp
30 lnx/tcuLnxEglPlatform.cpp
31 lnx/tcuLnxVulkanPlatform.hpp
32 lnx/tcuLnxVulkanPlatform.cpp
35 include_directories(lnx)
38 add_definitions(-DDEQP_SUPPORT_X11=1)
39 include_directories(lnx/X11)
41 message(STATUS "DEQP_SUPPORT_GLX = ${DEQP_SUPPORT_GLX}")
44 add_definitions(-DDEQP_SUPPORT_GLX=1)
47 set(TCUTIL_PLATFORM_SRCS
48 ${TCUTIL_PLATFORM_SRCS}
51 lnx/X11/tcuLnxX11EglDisplayFactory.hpp
52 lnx/X11/tcuLnxX11EglDisplayFactory.cpp
56 set(TCUTIL_PLATFORM_SRCS
57 ${TCUTIL_PLATFORM_SRCS}
58 lnx/X11/tcuLnxX11Xcb.hpp
59 lnx/X11/tcuLnxX11Xcb.cpp
64 set(TCUTIL_PLATFORM_SRCS
65 ${TCUTIL_PLATFORM_SRCS}
66 lnx/X11/tcuLnxX11GlxPlatform.hpp
67 lnx/X11/tcuLnxX11GlxPlatform.cpp
73 add_definitions(-DDEQP_SUPPORT_WAYLAND=1)
74 include_directories(lnx/wayland)
76 set(TCUTIL_PLATFORM_SRCS
77 ${TCUTIL_PLATFORM_SRCS}
78 lnx/wayland/tcuLnxWayland.hpp
79 lnx/wayland/tcuLnxWayland.cpp
80 lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
81 lnx/wayland/tcuLnxWaylandEglDisplayFactory.hpp
83 include_directories(wayland)
86 elseif (DE_OS_IS_UNIX AND DEQP_USE_SURFACELESS)
87 set(TCUTIL_PLATFORM_SRCS
88 surfaceless/tcuSurfacelessPlatform.hpp
89 surfaceless/tcuSurfacelessPlatform.cpp
92 elseif (DE_OS_IS_ANDROID)
93 set(TCUTIL_PLATFORM_SRCS
94 android/tcuAndroidExecService.cpp
95 android/tcuAndroidExecService.hpp
98 if (DE_ANDROID_API GREATER 8)
99 # Add NativeActivity code
100 set(TCUTIL_PLATFORM_SRCS
101 ${TCUTIL_PLATFORM_SRCS}
102 android/tcuAndroidAssets.cpp
103 android/tcuAndroidAssets.hpp
104 android/tcuAndroidInternals.cpp
105 android/tcuAndroidInternals.hpp
106 android/tcuAndroidNativeActivity.cpp
107 android/tcuAndroidNativeActivity.hpp
108 android/tcuAndroidPlatform.cpp
109 android/tcuAndroidPlatform.hpp
110 android/tcuAndroidRenderActivity.cpp
111 android/tcuAndroidRenderActivity.hpp
112 android/tcuAndroidTestActivity.cpp
113 android/tcuAndroidTestActivity.hpp
114 android/tcuAndroidUtil.cpp
115 android/tcuAndroidUtil.hpp
116 android/tcuAndroidWindow.cpp
117 android/tcuAndroidWindow.hpp
121 elseif (DE_OS_IS_IOS)
122 set(TCUTIL_PLATFORM_SRCS
125 ios/tcuIOSPlatform.mm
126 ios/tcuIOSPlatform.hh
129 elseif (DE_OS_IS_OSX)
130 set(TCUTIL_PLATFORM_SRCS
131 osx/tcuOSXPlatform.cpp
132 osx/tcuOSXPlatform.hpp
136 set(TCUTIL_PLATFORM_SRCS
137 vanilla/tcuVanillaPlatform.cpp
143 add_library(tcutil-platform STATIC ${TCUTIL_PLATFORM_SRCS})
145 # Add vkutil to the deps before tcutil so that it picks up the c++11 dependencies
146 target_link_libraries(tcutil-platform vkutil)
148 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS})
150 # Always link to glutil as some platforms such as Win32 always support GL
151 target_link_libraries(tcutil-platform glutil)
153 # Always link to eglutil
154 target_link_libraries(tcutil-platform eglutil)
158 find_package(X11 REQUIRED)
159 target_link_libraries(tcutil-platform ${X11_LIBRARIES})
161 find_package(XCB REQUIRED)
162 target_link_libraries(tcutil-platform ${XCB_LIBRARIES})
163 add_definitions(-DDEQP_SUPPORT_XCB=1)
165 if (DEQP_SUPPORT_GLX)
166 # GLX functions don't currently have wrappers, so link directly to libGL.
167 target_link_libraries(tcutil-platform GL)
169 if (DEQP_USE_WAYLAND)
170 find_package(Wayland REQUIRED)
171 target_link_libraries(tcutil-platform ${WAYLAND_LIBRARIES})
172 add_definitions(-DDEQP_SUPPORT_WAYLAND=1)