Home | History | Annotate | Download | only in platform
      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 			)
     17 
     18 		if (DEQP_SUPPORT_EGL)
     19 			set(TCUTIL_PLATFORM_SRCS
     20 				${TCUTIL_PLATFORM_SRCS}
     21 				win32/tcuWin32EGLNativeDisplayFactory.hpp
     22 				win32/tcuWin32EGLNativeDisplayFactory.cpp
     23 				)
     24 		endif()
     25 	elseif ((DE_OS_IS_UNIX OR DE_OS_IS_OSX) AND DEQP_USE_X11)
     26 		set(TCUTIL_PLATFORM_SRCS
     27 			X11/tcuX11.cpp
     28 			X11/tcuX11.hpp
     29 			X11/tcuX11Platform.hpp
     30 			X11/tcuX11Platform.cpp
     31 			)
     32 		if (DEQP_SUPPORT_EGL)
     33 			set(TCUTIL_PLATFORM_SRCS
     34 				${TCUTIL_PLATFORM_SRCS}
     35 				X11/tcuX11EglPlatform.hpp
     36 				X11/tcuX11EglPlatform.cpp
     37 				)
     38 		endif()
     39 		if (DEQP_SUPPORT_GLX)
     40 			set(TCUTIL_PLATFORM_SRCS
     41 				${TCUTIL_PLATFORM_SRCS}
     42 				X11/tcuX11GlxPlatform.hpp
     43 				X11/tcuX11GlxPlatform.cpp
     44 				)
     45 		endif()
     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")
     48 		endif ()
     49 	elseif (DE_OS_IS_ANDROID)
     50 		set(TCUTIL_PLATFORM_SRCS
     51 			android/tcuAndroidExecService.cpp
     52 			android/tcuAndroidExecService.hpp
     53 			)
     54 
     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/tcuAndroidNativeActivity.cpp
     62 				android/tcuAndroidNativeActivity.hpp
     63 				android/tcuAndroidPlatform.cpp
     64 				android/tcuAndroidPlatform.hpp
     65 				android/tcuAndroidRenderActivity.cpp
     66 				android/tcuAndroidRenderActivity.hpp
     67 				android/tcuAndroidTestActivity.cpp
     68 				android/tcuAndroidTestActivity.hpp
     69 				android/tcuAndroidUtil.cpp
     70 				android/tcuAndroidUtil.hpp
     71 				android/tcuAndroidWindow.cpp
     72 				android/tcuAndroidWindow.hpp
     73 				)
     74 		endif ()
     75 
     76 	elseif (DE_OS_IS_IOS)
     77 		set(TCUTIL_PLATFORM_SRCS
     78 			ios/tcuIOSApp.mm
     79 			ios/tcuIOSApp.h
     80 			ios/tcuIOSPlatform.mm
     81 			ios/tcuIOSPlatform.hh
     82 			)
     83 
     84 	elseif (DE_OS_IS_OSX)
     85 		set(TCUTIL_PLATFORM_SRCS
     86 			osx/tcuOSXPlatform.cpp
     87 			osx/tcuOSXPlatform.hpp
     88 			)
     89 
     90 	else ()
     91 		set(TCUTIL_PLATFORM_SRCS
     92 			vanilla/tcuVanillaPlatform.cpp
     93 			)
     94 
     95 	endif ()
     96 endif ()
     97 
     98 add_library(tcutil-platform STATIC ${TCUTIL_PLATFORM_SRCS})
     99 target_link_libraries(tcutil-platform tcutil ${TCUTIL_PLATFORM_LIBS})
    100 
    101 # Always link to glutil as some platforms such as Win32 always support GL
    102 target_link_libraries(tcutil-platform glutil)
    103 
    104 # Link to eglutil if platform supports EGL
    105 if (DEQP_SUPPORT_EGL)
    106 	target_link_libraries(tcutil-platform eglutil)
    107 endif ()
    108 
    109 # X11 libraries
    110 if (DEQP_USE_X11)
    111 	find_package(X11 REQUIRED)
    112 	target_link_libraries(tcutil-platform ${X11_LIBRARIES})
    113 	if (DEQP_SUPPORT_GLX)
    114 	  # GLX functions don't currently have wrappers, so link directly to libGL.
    115 	  target_link_libraries(tcutil-platform GL)
    116 	endif ()
    117 endif ()
    118