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
19 set(TCUTIL_PLATFORM_SRCS
20 ${TCUTIL_PLATFORM_SRCS}
21 win32/tcuWin32EGLNativeDisplayFactory.hpp
22 win32/tcuWin32EGLNativeDisplayFactory.cpp
25 elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND DEQP_USE_X11)
26 set(TCUTIL_PLATFORM_SRCS
29 X11/tcuX11Platform.hpp
30 X11/tcuX11Platform.cpp
33 set(TCUTIL_PLATFORM_SRCS
34 ${TCUTIL_PLATFORM_SRCS}
35 X11/tcuX11EglPlatform.hpp
36 X11/tcuX11EglPlatform.cpp
40 set(TCUTIL_PLATFORM_SRCS
41 ${TCUTIL_PLATFORM_SRCS}
42 X11/tcuX11GlxPlatform.hpp
43 X11/tcuX11GlxPlatform.cpp
46 if (NOT (DEQP_SUPPORT_EGL OR DEQP_SUPPORT_GLX))
47 message(FATAL_ERROR "At least one of EGL and GLX must be enabled for X11")
49 elseif (DE_OS_IS_ANDROID)
50 set(TCUTIL_PLATFORM_SRCS
51 android/tcuAndroidExecService.cpp
52 android/tcuAndroidExecService.hpp
55 if (DE_ANDROID_API GREATER 8)
56 # Add NativeActivity code
57 set(TCUTIL_PLATFORM_SRCS
58 ${TCUTIL_PLATFORM_SRCS}
59 android/tcuAndroidAssets.cpp
60 android/tcuAndroidAssets.hpp
61 android/tcuAndroidInternals.cpp
62 android/tcuAndroidInternals.hpp
63 android/tcuAndroidNativeActivity.cpp
64 android/tcuAndroidNativeActivity.hpp
65 android/tcuAndroidPlatform.cpp
66 android/tcuAndroidPlatform.hpp
67 android/tcuAndroidRenderActivity.cpp
68 android/tcuAndroidRenderActivity.hpp
69 android/tcuAndroidTestActivity.cpp
70 android/tcuAndroidTestActivity.hpp
71 android/tcuAndroidUtil.cpp
72 android/tcuAndroidUtil.hpp
73 android/tcuAndroidWindow.cpp
74 android/tcuAndroidWindow.hpp
79 set(TCUTIL_PLATFORM_SRCS
87 set(TCUTIL_PLATFORM_SRCS
88 osx/tcuOSXPlatform.cpp
89 osx/tcuOSXPlatform.hpp
93 set(TCUTIL_PLATFORM_SRCS
94 vanilla/tcuVanillaPlatform.cpp
100 add_library(tcutil-platform STATIC ${TCUTIL_PLATFORM_SRCS})
102 # Add vkutil to the deps before tcutil so that it picks up the c++11 dependencies
103 target_link_libraries(tcutil-platform vkutil)
105 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS})
107 # Always link to glutil as some platforms such as Win32 always support GL
108 target_link_libraries(tcutil-platform glutil)
110 # Link to eglutil if platform supports EGL
111 if (DEQP_SUPPORT_EGL)
112 target_link_libraries(tcutil-platform eglutil eglwrapper)
117 find_package(X11 REQUIRED)
118 target_link_libraries(tcutil-platform ${X11_LIBRARIES})
119 if (DEQP_SUPPORT_GLX)
120 # GLX functions don't currently have wrappers, so link directly to libGL.
121 target_link_libraries(tcutil-platform GL)