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)
23 set(TCUTIL_PLATFORM_SRCS
26 X11/tcuX11Platform.hpp
27 X11/tcuX11Platform.cpp
28 X11/tcuX11VulkanPlatform.hpp
29 X11/tcuX11VulkanPlatform.cpp
32 set(TCUTIL_PLATFORM_SRCS
33 ${TCUTIL_PLATFORM_SRCS}
39 set(TCUTIL_PLATFORM_SRCS
40 ${TCUTIL_PLATFORM_SRCS}
41 X11/tcuX11EglPlatform.hpp
42 X11/tcuX11EglPlatform.cpp
46 set(TCUTIL_PLATFORM_SRCS
47 ${TCUTIL_PLATFORM_SRCS}
48 X11/tcuX11GlxPlatform.hpp
49 X11/tcuX11GlxPlatform.cpp
52 if (NOT (DEQP_SUPPORT_EGL OR DEQP_SUPPORT_GLX))
53 message(FATAL_ERROR "At least one of EGL and GLX must be enabled for X11")
55 elseif (DE_OS_IS_ANDROID)
56 set(TCUTIL_PLATFORM_SRCS
57 android/tcuAndroidExecService.cpp
58 android/tcuAndroidExecService.hpp
61 if (DE_ANDROID_API GREATER 8)
62 # Add NativeActivity code
63 set(TCUTIL_PLATFORM_SRCS
64 ${TCUTIL_PLATFORM_SRCS}
65 android/tcuAndroidAssets.cpp
66 android/tcuAndroidAssets.hpp
67 android/tcuAndroidInternals.cpp
68 android/tcuAndroidInternals.hpp
69 android/tcuAndroidNativeActivity.cpp
70 android/tcuAndroidNativeActivity.hpp
71 android/tcuAndroidPlatform.cpp
72 android/tcuAndroidPlatform.hpp
73 android/tcuAndroidRenderActivity.cpp
74 android/tcuAndroidRenderActivity.hpp
75 android/tcuAndroidTestActivity.cpp
76 android/tcuAndroidTestActivity.hpp
77 android/tcuAndroidUtil.cpp
78 android/tcuAndroidUtil.hpp
79 android/tcuAndroidWindow.cpp
80 android/tcuAndroidWindow.hpp
85 set(TCUTIL_PLATFORM_SRCS
93 set(TCUTIL_PLATFORM_SRCS
94 osx/tcuOSXPlatform.cpp
95 osx/tcuOSXPlatform.hpp
99 set(TCUTIL_PLATFORM_SRCS
100 vanilla/tcuVanillaPlatform.cpp
106 add_library(tcutil-platform STATIC ${TCUTIL_PLATFORM_SRCS})
108 # Add vkutil to the deps before tcutil so that it picks up the c++11 dependencies
109 target_link_libraries(tcutil-platform vkutil)
111 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS})
113 # Always link to glutil as some platforms such as Win32 always support GL
114 target_link_libraries(tcutil-platform glutil)
116 # Always link to eglutil
117 target_link_libraries(tcutil-platform eglutil)
121 find_package(X11 REQUIRED)
122 target_link_libraries(tcutil-platform ${X11_LIBRARIES})
124 find_package(XCB REQUIRED)
125 target_link_libraries(tcutil-platform ${XCB_LIBRARIES})
126 add_definitions(-DDEQP_SUPPORT_XCB=1)
128 if (DEQP_SUPPORT_GLX)
129 # GLX functions don't currently have wrappers, so link directly to libGL.
130 target_link_libraries(tcutil-platform GL)