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_ANDROID)
87 set(TCUTIL_PLATFORM_SRCS
88 android/tcuAndroidExecService.cpp
89 android/tcuAndroidExecService.hpp
92 if (DE_ANDROID_API GREATER 8)
93 # Add NativeActivity code
94 set(TCUTIL_PLATFORM_SRCS
95 ${TCUTIL_PLATFORM_SRCS}
96 android/tcuAndroidAssets.cpp
97 android/tcuAndroidAssets.hpp
98 android/tcuAndroidInternals.cpp
99 android/tcuAndroidInternals.hpp
100 android/tcuAndroidNativeActivity.cpp
101 android/tcuAndroidNativeActivity.hpp
102 android/tcuAndroidPlatform.cpp
103 android/tcuAndroidPlatform.hpp
104 android/tcuAndroidRenderActivity.cpp
105 android/tcuAndroidRenderActivity.hpp
106 android/tcuAndroidTestActivity.cpp
107 android/tcuAndroidTestActivity.hpp
108 android/tcuAndroidUtil.cpp
109 android/tcuAndroidUtil.hpp
110 android/tcuAndroidWindow.cpp
111 android/tcuAndroidWindow.hpp
115 elseif (DE_OS_IS_IOS)
116 set(TCUTIL_PLATFORM_SRCS
119 ios/tcuIOSPlatform.mm
120 ios/tcuIOSPlatform.hh
123 elseif (DE_OS_IS_OSX)
124 set(TCUTIL_PLATFORM_SRCS
125 osx/tcuOSXPlatform.cpp
126 osx/tcuOSXPlatform.hpp
130 set(TCUTIL_PLATFORM_SRCS
131 vanilla/tcuVanillaPlatform.cpp
137 add_library(tcutil-platform STATIC ${TCUTIL_PLATFORM_SRCS})
139 # Add vkutil to the deps before tcutil so that it picks up the c++11 dependencies
140 target_link_libraries(tcutil-platform vkutil)
142 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS})
144 # Always link to glutil as some platforms such as Win32 always support GL
145 target_link_libraries(tcutil-platform glutil)
147 # Always link to eglutil
148 target_link_libraries(tcutil-platform eglutil)
152 find_package(X11 REQUIRED)
153 target_link_libraries(tcutil-platform ${X11_LIBRARIES})
155 find_package(XCB REQUIRED)
156 target_link_libraries(tcutil-platform ${XCB_LIBRARIES})
157 add_definitions(-DDEQP_SUPPORT_XCB=1)
159 if (DEQP_SUPPORT_GLX)
160 # GLX functions don't currently have wrappers, so link directly to libGL.
161 target_link_libraries(tcutil-platform GL)
163 if (DEQP_USE_WAYLAND)
164 find_package(Wayland REQUIRED)
165 target_link_libraries(tcutil-platform ${WAYLAND_LIBRARIES})
166 add_definitions(-DDEQP_SUPPORT_WAYLAND=1)