1 # Platform port library 2 3 # Target file may define TCUTIL_PLATFORM_SRCS 4 if (NOT DEFINED TCUTIL_PLATFORM_SRCS) 5 if (DE_OS_IS_WIN32) 6 set(TCUTIL_PLATFORM_SRCS 7 win32/tcuWin32Platform.hpp 8 win32/tcuWin32Platform.cpp 9 win32/tcuWGLContextFactory.hpp 10 win32/tcuWGLContextFactory.cpp 11 win32/tcuWGL.hpp 12 win32/tcuWGL.cpp 13 win32/tcuWin32API.h 14 win32/tcuWin32Window.cpp 15 win32/tcuWin32Window.hpp 16 win32/tcuWin32EGLNativeDisplayFactory.hpp 17 win32/tcuWin32EGLNativeDisplayFactory.cpp 18 win32/tcuWin32VulkanPlatform.hpp 19 win32/tcuWin32VulkanPlatform.cpp 20 ) 21 22 elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND DEQP_USE_X11) 23 message(STATUS "DEQP_SUPPORT_GLX = ${DEQP_SUPPORT_GLX}") 24 if (DEQP_SUPPORT_GLX) 25 add_definitions(-DDEQP_SUPPORT_GLX=1) 26 endif () 27 28 set(TCUTIL_PLATFORM_SRCS 29 X11/tcuX11.cpp 30 X11/tcuX11.hpp 31 X11/tcuX11EglPlatform.hpp 32 X11/tcuX11EglPlatform.cpp 33 X11/tcuX11Platform.hpp 34 X11/tcuX11Platform.cpp 35 X11/tcuX11VulkanPlatform.hpp 36 X11/tcuX11VulkanPlatform.cpp 37 ) 38 if (DEQP_USE_XCB) 39 set(TCUTIL_PLATFORM_SRCS 40 ${TCUTIL_PLATFORM_SRCS} 41 X11/tcuX11Xcb.hpp 42 X11/tcuX11Xcb.cpp 43 ) 44 endif() 45 if (DEQP_SUPPORT_GLX) 46 set(TCUTIL_PLATFORM_SRCS 47 ${TCUTIL_PLATFORM_SRCS} 48 X11/tcuX11GlxPlatform.hpp 49 X11/tcuX11GlxPlatform.cpp 50 ) 51 endif() 52 elseif (DE_OS_IS_ANDROID) 53 set(TCUTIL_PLATFORM_SRCS 54 android/tcuAndroidExecService.cpp 55 android/tcuAndroidExecService.hpp 56 ) 57 58 if (DE_ANDROID_API GREATER 8) 59 # Add NativeActivity code 60 set(TCUTIL_PLATFORM_SRCS 61 ${TCUTIL_PLATFORM_SRCS} 62 android/tcuAndroidAssets.cpp 63 android/tcuAndroidAssets.hpp 64 android/tcuAndroidInternals.cpp 65 android/tcuAndroidInternals.hpp 66 android/tcuAndroidNativeActivity.cpp 67 android/tcuAndroidNativeActivity.hpp 68 android/tcuAndroidPlatform.cpp 69 android/tcuAndroidPlatform.hpp 70 android/tcuAndroidRenderActivity.cpp 71 android/tcuAndroidRenderActivity.hpp 72 android/tcuAndroidTestActivity.cpp 73 android/tcuAndroidTestActivity.hpp 74 android/tcuAndroidUtil.cpp 75 android/tcuAndroidUtil.hpp 76 android/tcuAndroidWindow.cpp 77 android/tcuAndroidWindow.hpp 78 ) 79 endif () 80 81 elseif (DE_OS_IS_IOS) 82 set(TCUTIL_PLATFORM_SRCS 83 ios/tcuIOSApp.mm 84 ios/tcuIOSApp.h 85 ios/tcuIOSPlatform.mm 86 ios/tcuIOSPlatform.hh 87 ) 88 89 elseif (DE_OS_IS_OSX) 90 set(TCUTIL_PLATFORM_SRCS 91 osx/tcuOSXPlatform.cpp 92 osx/tcuOSXPlatform.hpp 93 ) 94 95 else () 96 set(TCUTIL_PLATFORM_SRCS 97 vanilla/tcuVanillaPlatform.cpp 98 ) 99 100 endif () 101 endif () 102 103 add_library(tcutil-platform STATIC ${TCUTIL_PLATFORM_SRCS}) 104 105 # Add vkutil to the deps before tcutil so that it picks up the c++11 dependencies 106 target_link_libraries(tcutil-platform vkutil) 107 108 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS}) 109 110 # Always link to glutil as some platforms such as Win32 always support GL 111 target_link_libraries(tcutil-platform glutil) 112 113 # Always link to eglutil 114 target_link_libraries(tcutil-platform eglutil) 115 116 # X11 libraries 117 if (DEQP_USE_X11) 118 find_package(X11 REQUIRED) 119 target_link_libraries(tcutil-platform ${X11_LIBRARIES}) 120 if (DEQP_USE_XCB) 121 find_package(XCB REQUIRED) 122 target_link_libraries(tcutil-platform ${XCB_LIBRARIES}) 123 add_definitions(-DDEQP_SUPPORT_XCB=1) 124 endif () 125 if (DEQP_SUPPORT_GLX) 126 # GLX functions don't currently have wrappers, so link directly to libGL. 127 target_link_libraries(tcutil-platform GL) 128 endif () 129 endif () 130