Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 1 | # dEQP cmake file |
| 2 | |
Chad Versace | b5cd0ad | 2017-11-03 09:36:30 -0700 | [diff] [blame] | 3 | # Module FindGit requires cmake >= 2.8.2 |
Alexander Galazin | bd3f2c0 | 2019-06-06 09:25:19 +0200 | [diff] [blame] | 4 | cmake_minimum_required(VERSION 3.0) |
Chad Versace | b5cd0ad | 2017-11-03 09:36:30 -0700 | [diff] [blame] | 5 | |
| 6 | find_package(Git) |
Alexander Galazin | b1e5e37 | 2019-04-23 21:09:43 +0200 | [diff] [blame] | 7 | find_package(PythonInterp 3) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 8 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 9 | # dEQP Target. |
| 10 | set(DEQP_TARGET "default" CACHE STRING "dEQP Target (default, android...)") |
| 11 | |
Pyry Haulos | 69bb2f6 | 2017-03-27 11:21:37 -0700 | [diff] [blame] | 12 | if (DEFINED DEQP_TARGET_TOOLCHAIN) |
| 13 | # \note Toolchain must be included before project() command |
Jesse Hall | ba94ca6 | 2017-08-04 14:24:10 -0700 | [diff] [blame] | 14 | include(targets/${DEQP_TARGET}/${DEQP_TARGET_TOOLCHAIN}.cmake NO_POLICY_SCOPE) |
Pyry Haulos | 69bb2f6 | 2017-03-27 11:21:37 -0700 | [diff] [blame] | 15 | endif () |
| 16 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 17 | project(dEQP-Core-${DEQP_TARGET}) |
| 18 | |
Pyry Haulos | eccd5bc | 2015-02-03 10:48:09 -0800 | [diff] [blame] | 19 | include(framework/delibs/cmake/Defs.cmake NO_POLICY_SCOPE) |
| 20 | include(framework/delibs/cmake/CFlags.cmake) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 21 | |
| 22 | add_definitions(-DDE_ASSERT_FAILURE_CALLBACK) |
| 23 | |
| 24 | # dEQP-specific configuration. Target file should override these. |
| 25 | set(DEQP_TARGET_NAME "UNKNOWN") # Target name |
| 26 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 27 | set(DEQP_GLES2_LIBRARIES ) # GLESv2 libraries. If empty, run-time linking is used |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 28 | set(DEQP_GLES3_LIBRARIES ) # GLESv3 libraries. If empty, run-time linking is used |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 29 | set(DEQP_EGL_LIBRARIES ) # EGL libraries |
| 30 | |
Pyry Haulos | d98514b | 2016-10-12 13:22:41 -0700 | [diff] [blame] | 31 | # Legacy APIs that don't use run-time loading |
| 32 | set(DEQP_SUPPORT_GLES1 OFF) # Is GLESv1 supported |
| 33 | set(DEQP_GLES1_LIBRARIES ) # GLESv1 libraries |
| 34 | set(DEQP_SUPPORT_VG OFF) # Is OpenVG supported |
| 35 | set(DEQP_VG_LIBRARIES ) # VG libraries |
| 36 | |
Pyry Haulos | cdeac44 | 2016-11-17 15:29:14 -0800 | [diff] [blame] | 37 | set(DEQP_SUPPORT_WGL OFF) |
Pyry Haulos | d98514b | 2016-10-12 13:22:41 -0700 | [diff] [blame] | 38 | set(DEQP_SUPPORT_GLX OFF) # Is GLX supported \todo [2016-10-12 pyry] X11 specific - move to framework/platform/ |
Jarkko Pöyry | 573d323 | 2015-02-24 21:05:42 -0800 | [diff] [blame] | 39 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 40 | set(DEQP_PLATFORM_LIBRARIES ) # Other platform libraries |
| 41 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 42 | set(DEQP_PLATFORM_COPY_LIBRARIES ) # Libraries / binaries that need to be copied to binary directory |
| 43 | |
| 44 | # Delibs include directories |
| 45 | include_directories( |
Pyry Haulos | eccd5bc | 2015-02-03 10:48:09 -0800 | [diff] [blame] | 46 | framework/delibs/debase |
| 47 | framework/delibs/decpp |
| 48 | framework/delibs/depool |
| 49 | framework/delibs/dethread |
| 50 | framework/delibs/deutil |
| 51 | framework/delibs/destream |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 52 | ) |
| 53 | |
| 54 | # Include target-specific definitions |
| 55 | include(targets/${DEQP_TARGET}/${DEQP_TARGET}.cmake) |
| 56 | |
Pyry Haulos | fe01ea4 | 2014-09-24 12:12:26 -0700 | [diff] [blame] | 57 | # zlib |
Thomas Spurden | 67b58ed | 2019-10-25 11:50:34 +0100 | [diff] [blame] | 58 | find_package(ZLIB) |
| 59 | # dEQP CMake compatibility (as for libpng) |
| 60 | set(ZLIB_INCLUDE_PATH ${ZLIB_INCLUDE_DIRS}) |
| 61 | set(ZLIB_LIBRARY ${ZLIB_LIBRARIES}) |
Pyry Haulos | fe01ea4 | 2014-09-24 12:12:26 -0700 | [diff] [blame] | 62 | |
| 63 | if (NOT ZLIB_INCLUDE_PATH OR NOT ZLIB_LIBRARY) |
| 64 | message(STATUS "System version of zlib not found, using external/zlib") |
| 65 | add_subdirectory(external/zlib) |
| 66 | # \note ZLIB_LIBRARY and ZLIB_INCLUDE_PATH are promoted from external/zlib/CMakeLists.txt |
| 67 | endif () |
| 68 | |
| 69 | include_directories(${ZLIB_INCLUDE_PATH}) |
| 70 | |
| 71 | # libpng |
Chad Versace | df62859 | 2016-12-02 15:43:08 -0800 | [diff] [blame] | 72 | # |
| 73 | # The FindPNG module defines PNG_INCLUDE_DIRS and PNG_LIBRARIES. But dEQP's |
| 74 | # CMake files expect the non-standard PNG_INCLUDE_PATH and PNG_LIBRARY. Set the |
| 75 | # non-standard variables here to retain compatibility with dEQP's existing |
| 76 | # CMake files. |
Thomas Spurden | 67b58ed | 2019-10-25 11:50:34 +0100 | [diff] [blame] | 77 | find_package(PNG) |
Chad Versace | df62859 | 2016-12-02 15:43:08 -0800 | [diff] [blame] | 78 | set(PNG_INCLUDE_PATH ${PNG_INCLUDE_DIRS}) |
| 79 | set(PNG_LIBRARY ${PNG_LIBRARIES}) |
Pyry Haulos | fe01ea4 | 2014-09-24 12:12:26 -0700 | [diff] [blame] | 80 | |
| 81 | if (NOT PNG_INCLUDE_PATH OR NOT PNG_LIBRARY) |
| 82 | message(STATUS "System version of libpng not found, using external/libpng") |
| 83 | add_subdirectory(external/libpng) |
| 84 | # \note PNG_LIBRARY and PNG_INCLUDE_PATH are promoted from external/libpng/CMakeLists.txt |
| 85 | endif () |
| 86 | |
Pyry Haulos | 29ae4d1 | 2015-06-19 15:25:34 -0700 | [diff] [blame] | 87 | # glslang |
| 88 | add_subdirectory(external/glslang) |
| 89 | |
Andrew Woloszyn | 7485f0b | 2015-09-04 15:50:45 -0400 | [diff] [blame] | 90 | # spirv-tools |
| 91 | add_subdirectory(external/spirv-tools) |
| 92 | |
Paavo Pessi | 646ff42 | 2018-04-19 14:47:40 +0300 | [diff] [blame] | 93 | # spirv-headers |
Alexander Galazin | f620cc9 | 2018-07-20 12:51:58 +0200 | [diff] [blame] | 94 | set(SPIRV_INCLUDE_PATH "${PROJECT_SOURCE_DIR}/external/spirv-headers/src/include") |
| 95 | if (NOT EXISTS ${SPIRV_INCLUDE_PATH}) |
| 96 | message(FATAL_ERROR "SPIR-V headers not found, please run external/fetch_sources.py") |
| 97 | endif() |
| 98 | include_directories(${SPIRV_INCLUDE_PATH}) |
Paavo Pessi | 646ff42 | 2018-04-19 14:47:40 +0300 | [diff] [blame] | 99 | |
Dan Sinclair | 64a4105 | 2019-01-03 15:37:57 -0500 | [diff] [blame] | 100 | # Amber |
| 101 | add_subdirectory(external/amber) |
| 102 | include_directories(external/amber) |
| 103 | |
Cygan, Slawomir | 8b12641 | 2018-07-05 18:54:09 +0200 | [diff] [blame] | 104 | # RenderDoc API |
| 105 | include_directories(external/renderdoc/src) |
| 106 | |
Pyry Haulos | fe01ea4 | 2014-09-24 12:12:26 -0700 | [diff] [blame] | 107 | include_directories(${PNG_INCLUDE_PATH}) |
| 108 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 109 | message(STATUS "DEQP_TARGET_NAME = ${DEQP_TARGET_NAME}") |
| 110 | message(STATUS "DEQP_SUPPORT_GLES1 = ${DEQP_SUPPORT_GLES1}") |
| 111 | message(STATUS "DEQP_GLES1_LIBRARIES = ${DEQP_GLES1_LIBRARIES}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 112 | message(STATUS "DEQP_GLES2_LIBRARIES = ${DEQP_GLES2_LIBRARIES}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 113 | message(STATUS "DEQP_GLES3_LIBRARIES = ${DEQP_GLES3_LIBRARIES}") |
Pyry Haulos | 933ef4d | 2016-11-14 13:01:12 -0800 | [diff] [blame] | 114 | message(STATUS "DEQP_GLES31_LIBRARIES = ${DEQP_GLES31_LIBRARIES}") |
Pyry Haulos | bc24f75 | 2016-11-14 16:17:12 -0800 | [diff] [blame] | 115 | message(STATUS "DEQP_GLES32_LIBRARIES = ${DEQP_GLES32_LIBRARIES}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 116 | message(STATUS "DEQP_SUPPORT_VG = ${DEQP_SUPPORT_VG}") |
| 117 | message(STATUS "DEQP_VG_LIBRARIES = ${DEQP_VG_LIBRARIES}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 118 | message(STATUS "DEQP_EGL_LIBRARIES = ${DEQP_EGL_LIBRARIES}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 119 | message(STATUS "DEQP_PLATFORM_LIBRARIES = ${DEQP_PLATFORM_LIBRARIES}") |
| 120 | |
| 121 | # Defines |
| 122 | add_definitions(-DDEQP_TARGET_NAME="${DEQP_TARGET_NAME}") |
| 123 | |
Pyry Haulos | 933ef4d | 2016-11-14 13:01:12 -0800 | [diff] [blame] | 124 | # Entry points loaded directly by linking to libGL*? |
| 125 | if (DEFINED DEQP_GLES2_LIBRARIES) |
| 126 | add_definitions(-DDEQP_GLES2_DIRECT_LINK=1) |
| 127 | endif () |
| 128 | |
| 129 | if (DEFINED DEQP_GLES3_LIBRARIES) |
| 130 | add_definitions(-DDEQP_GLES3_DIRECT_LINK=1) |
| 131 | endif () |
| 132 | |
| 133 | if (DEFINED DEQP_GLES31_LIBRARIES) |
| 134 | add_definitions(-DDEQP_GLES31_DIRECT_LINK=1) |
| 135 | endif () |
| 136 | |
| 137 | if (DEFINED DEQP_GLES32_LIBRARIES) |
| 138 | add_definitions(-DDEQP_GLES32_DIRECT_LINK=1) |
| 139 | endif () |
| 140 | |
| 141 | if (DEFINED DEQP_EGL_LIBRARIES) |
| 142 | add_definitions(-DDEQP_EGL_DIRECT_LINK=1) |
| 143 | endif () |
| 144 | |
| 145 | # Legacy APIs that don't support run-time loading |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 146 | if (DEQP_SUPPORT_GLES1) |
| 147 | add_definitions(-DDEQP_SUPPORT_GLES1=1) |
Pyry Haulos | 933ef4d | 2016-11-14 13:01:12 -0800 | [diff] [blame] | 148 | |
| 149 | if (NOT DEFINED DEQP_GLES1_LIBRARIES) |
| 150 | message(FATAL_ERROR "Run-time loading of GLES1 is not supported (DEQP_GLES1_LIBRARIES is not set)") |
| 151 | endif () |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 152 | endif () |
| 153 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 154 | if (DEQP_SUPPORT_VG) |
| 155 | add_definitions(-DDEQP_SUPPORT_VG=1) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 156 | |
Pyry Haulos | 933ef4d | 2016-11-14 13:01:12 -0800 | [diff] [blame] | 157 | if (NOT DEFINED DEQP_VG_LIBRARIES) |
| 158 | message(FATAL_ERROR "Run-time loading of VG is not supported (DEQP_VG_LIBRARIES is not set)") |
| 159 | endif () |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 160 | endif () |
| 161 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 162 | if (DE_COMPILER_IS_MSC) |
| 163 | # Don't nag about std::copy for example |
| 164 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS") |
| 165 | endif () |
| 166 | |
Jeff Bolz | 3c40ed9 | 2018-10-18 23:00:34 -0500 | [diff] [blame] | 167 | # Precompiled header macro. Parameters are source file list and filename for pch cpp file. |
| 168 | macro(PCH SRCS PCHCPP) |
Jeff Bolz | 3db647b | 2018-11-19 09:06:49 -0600 | [diff] [blame] | 169 | if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio") |
| 170 | set(PCH_NAME "$(IntDir)\\pch.pch") |
Jeff Bolz | 3c40ed9 | 2018-10-18 23:00:34 -0500 | [diff] [blame] | 171 | # make source files use/depend on PCH_NAME |
| 172 | set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME}" OBJECT_DEPENDS "${PCH_NAME}") |
| 173 | # make PCHCPP file compile and generate PCH_NAME |
| 174 | set_source_files_properties(${PCHCPP} PROPERTIES COMPILE_FLAGS "/Ycpch.h /Fp${PCH_NAME}" OBJECT_OUTPUTS "${PCH_NAME}") |
| 175 | list(APPEND ${SRCS} "${PCHCPP}") |
| 176 | endif() |
| 177 | endmacro(PCH) |
| 178 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 179 | # delibs projects |
Pyry Haulos | eccd5bc | 2015-02-03 10:48:09 -0800 | [diff] [blame] | 180 | add_subdirectory(framework/delibs/debase) |
| 181 | add_subdirectory(framework/delibs/depool) |
| 182 | add_subdirectory(framework/delibs/dethread) |
| 183 | add_subdirectory(framework/delibs/destream) |
| 184 | add_subdirectory(framework/delibs/deutil) |
| 185 | add_subdirectory(framework/delibs/decpp) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 186 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 187 | # ExecServer |
| 188 | add_subdirectory(execserver) |
| 189 | |
| 190 | # Executor framework and tools |
| 191 | if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/executor) |
| 192 | add_subdirectory(executor) |
| 193 | endif () |
| 194 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 195 | # Test framework include directories |
| 196 | include_directories( |
| 197 | framework/common |
| 198 | framework/qphelper |
| 199 | framework/opengl |
| 200 | framework/opengl/wrapper |
| 201 | framework/referencerenderer |
| 202 | framework/opengl/simplereference |
| 203 | framework/randomshaders |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 204 | framework/egl |
| 205 | framework/egl/wrapper |
Piotr Byszewski | e14df7f | 2020-03-03 14:51:54 +0100 | [diff] [blame^] | 206 | framework/xexml |
Pyry Haulos | 846cc3c | 2015-06-29 14:28:58 -0700 | [diff] [blame] | 207 | external/vulkancts/framework/vulkan |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 208 | ) |
| 209 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 210 | if (DE_OS_IS_ANDROID OR DE_OS_IS_IOS) |
| 211 | # On Android deqp modules are compiled as libraries and linked into final .so |
| 212 | set(DEQP_MODULE_LIBRARIES ) |
| 213 | set(DEQP_MODULE_ENTRY_POINTS ) |
| 214 | endif () |
| 215 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 216 | # Macro for adding targets for copying binaries (usually target libraries) to the target destination dir |
| 217 | macro (target_copy_files target dep_name files) |
| 218 | if (NOT "${files}" STREQUAL "") |
| 219 | set(COPY_TARGETS ) |
| 220 | foreach (SRCNAME ${files}) |
| 221 | get_filename_component(BASENAME ${SRCNAME} NAME) |
| 222 | set(DSTNAME "${CMAKE_CURRENT_BINARY_DIR}/${BASENAME}") |
| 223 | add_custom_command(OUTPUT ${DSTNAME} |
| 224 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SRCNAME} ${DSTNAME}) |
| 225 | set(COPY_TARGETS ${COPY_TARGETS} ${DSTNAME}) |
| 226 | endforeach () |
| 227 | |
| 228 | add_custom_target(${dep_name} ALL DEPENDS ${COPY_TARGETS}) |
| 229 | add_dependencies(${target} ${dep_name}) |
| 230 | endif () |
| 231 | endmacro (target_copy_files) |
| 232 | |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 233 | set(MODULE_LIB_TARGET_POSTFIX "-package") |
| 234 | set(MODULE_DATA_TARGET_POSTFIX "-data") |
| 235 | |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 236 | # Macro for adding dEQP module |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 237 | # This adds 3 targets: |
| 238 | # ${MODULE_NAME}-package: Static library that contains all SRCS and links to LIBS |
| 239 | # ${MODULE_NAME}-data: Custom target that is used for data file copies |
| 240 | # ${MODULE_NAME}: Executable binary (if supported by the platform) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 241 | macro (add_deqp_module MODULE_NAME SRCS LIBS ENTRY) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 242 | |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 243 | # Library target |
| 244 | add_library("${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}" STATIC ${SRCS}) |
| 245 | target_link_libraries("${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}" ${LIBS}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 246 | |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 247 | set(DEQP_MODULE_LIBRARIES ${DEQP_MODULE_LIBRARIES} "${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}") |
| 248 | set(DEQP_MODULE_ENTRY_POINTS ${DEQP_MODULE_ENTRY_POINTS} "${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 249 | |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 250 | # Forward to parent scope |
| 251 | set(DEQP_MODULE_LIBRARIES ${DEQP_MODULE_LIBRARIES} PARENT_SCOPE) |
| 252 | set(DEQP_MODULE_ENTRY_POINTS ${DEQP_MODULE_ENTRY_POINTS} PARENT_SCOPE) |
| 253 | |
| 254 | if (NOT DE_OS_IS_ANDROID AND NOT DE_OS_IS_IOS) |
| 255 | # Executable target |
| 256 | add_executable(${MODULE_NAME} ${PROJECT_SOURCE_DIR}/framework/platform/tcuMain.cpp ${ENTRY}) |
| 257 | target_link_libraries(${MODULE_NAME} tcutil-platform "${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 258 | target_copy_files(${MODULE_NAME} platform-libs-${MODULE_NAME} "${DEQP_PLATFORM_COPY_LIBRARIES}") |
| 259 | endif () |
| 260 | |
| 261 | # Data file target |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 262 | add_custom_target("${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}") |
| 263 | add_dependencies("${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}" "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}") |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 264 | endmacro (add_deqp_module) |
| 265 | |
| 266 | # Macro for adding data dirs to module |
| 267 | macro (add_data_dir MODULE_NAME SRC_DIR DST_DIR) |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 268 | if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX OR DE_OS_IS_OSX OR DE_OS_IS_QNX) |
| 269 | add_custom_command(TARGET "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${DST_DIR}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 270 | |
| 271 | elseif (DE_OS_IS_ANDROID) |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 272 | add_custom_command(TARGET "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR} ${CMAKE_BINARY_DIR}/assets/${DST_DIR}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 273 | |
| 274 | elseif (DE_OS_IS_IOS) |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 275 | add_custom_command(TARGET "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR} ${CMAKE_BINARY_DIR}/\${CONFIGURATION}\${EFFECTIVE_PLATFORM_NAME}/deqp.app/${DST_DIR}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 276 | endif () |
| 277 | endmacro (add_data_dir) |
| 278 | |
| 279 | # Macro for adding individual data files to module |
| 280 | macro (add_data_file MODULE_NAME SRC_FILE DST_FILE) |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 281 | if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX OR DE_OS_IS_OSX OR DE_OS_IS_QNX) |
| 282 | add_custom_command(TARGET "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DST_FILE}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 283 | |
| 284 | elseif (DE_OS_IS_ANDROID) |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 285 | add_custom_command(TARGET "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FILE} ${CMAKE_BINARY_DIR}/assets/${DST_FILE}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 286 | |
| 287 | elseif (DE_OS_IS_IOS) |
Pyry Haulos | a338d91 | 2016-11-15 13:54:58 -0800 | [diff] [blame] | 288 | add_custom_command(TARGET "${MODULE_NAME}${MODULE_DATA_TARGET_POSTFIX}" POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FILE} ${CMAKE_BINARY_DIR}/\${CONFIGURATION}\${EFFECTIVE_PLATFORM_NAME}/deqp.app/${DST_FILE}) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 289 | endif () |
| 290 | endmacro (add_data_file) |
| 291 | |
| 292 | add_subdirectory(framework) |
Pyry Haulos | 846cc3c | 2015-06-29 14:28:58 -0700 | [diff] [blame] | 293 | add_subdirectory(external/vulkancts/framework/vulkan) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 294 | |
| 295 | if (DE_COMPILER_IS_MSC) |
| 296 | add_compile_options(/bigobj) # Required by glsBuiltinPrecisionTests.cpp |
| 297 | endif () |
| 298 | |
| 299 | add_subdirectory(modules) |
Pyry Haulos | 846cc3c | 2015-06-29 14:28:58 -0700 | [diff] [blame] | 300 | add_subdirectory(external/vulkancts/modules/vulkan) |
Pyry Haulos | 48087f5 | 2016-11-14 11:03:22 -0800 | [diff] [blame] | 301 | add_subdirectory(external/openglcts) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 302 | |
| 303 | # Single-binary targets |
| 304 | if (DE_OS_IS_ANDROID) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 305 | include_directories(executor) |
| 306 | |
Pyry Haulos | cdeac44 | 2016-11-17 15:29:14 -0800 | [diff] [blame] | 307 | set(DEQP_SRCS |
| 308 | framework/platform/android/tcuAndroidMain.cpp |
| 309 | framework/platform/android/tcuAndroidJNI.cpp |
| 310 | framework/platform/android/tcuAndroidPlatformCapabilityQueryJNI.cpp |
| 311 | framework/platform/android/tcuTestLogParserJNI.cpp |
| 312 | ${DEQP_MODULE_ENTRY_POINTS} |
| 313 | ) |
| 314 | |
| 315 | set(DEQP_LIBS |
| 316 | tcutil-platform |
| 317 | xecore |
| 318 | ${DEQP_MODULE_LIBRARIES} |
| 319 | ) |
| 320 | |
| 321 | add_library(deqp SHARED ${DEQP_SRCS}) |
| 322 | target_link_libraries(deqp ${DEQP_LIBS}) |
| 323 | |
Chris Forbes | 651bd0d | 2018-06-13 23:23:02 -0700 | [diff] [blame] | 324 | # Separate out the debug information because it's enormous |
| 325 | add_custom_command(TARGET deqp POST_BUILD |
| 326 | COMMAND ${CMAKE_STRIP} --only-keep-debug -o $<TARGET_FILE:deqp>.debug $<TARGET_FILE:deqp> |
| 327 | COMMAND ${CMAKE_STRIP} -g $<TARGET_FILE:deqp>) |
| 328 | |
Pyry Haulos | cdeac44 | 2016-11-17 15:29:14 -0800 | [diff] [blame] | 329 | # Needed by OpenGL CTS that defines its own activity but depends on |
| 330 | # common Android support code. |
| 331 | target_include_directories(deqp PRIVATE framework/platform/android) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 332 | |
| 333 | elseif (DE_OS_IS_IOS) |
| 334 | # Code sign identity |
| 335 | set(DEQP_IOS_CODE_SIGN_IDENTITY "drawElements" CACHE STRING "Code sign identity for iOS build") |
| 336 | |
| 337 | set(MACOSX_BUNDLE_PRODUCT_NAME "\${PRODUCT_NAME}") |
| 338 | set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.drawelements.\${PRODUCT_NAME:identifier}") |
| 339 | |
| 340 | include_directories(framework/platform/ios) |
| 341 | set(TESTERCORE_SRC_FILES |
| 342 | framework/platform/ios/tcuEAGLView.h |
| 343 | framework/platform/ios/tcuEAGLView.m |
| 344 | framework/platform/ios/tcuIOSAppDelegate.h |
| 345 | framework/platform/ios/tcuIOSAppDelegate.m |
| 346 | framework/platform/ios/tcuIOSViewController.h |
| 347 | framework/platform/ios/tcuIOSViewController.m |
| 348 | framework/platform/ios/tcuIOSMain.m |
| 349 | ) |
| 350 | set_source_files_properties(${TESTERCORE_SRC_FILES} COMPILE_FLAGS "-std=c99") |
| 351 | |
| 352 | add_executable(deqp MACOSX_BUNDLE ${TESTERCORE_SRC_FILES} ${DEQP_MODULE_ENTRY_POINTS}) |
| 353 | target_link_libraries(deqp tcutil-platform xscore ${DEQP_MODULE_LIBRARIES}) |
| 354 | set_target_properties(deqp PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") |
| 355 | set_target_properties(deqp PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer: ${DEQP_IOS_CODE_SIGN_IDENTITY}") |
| 356 | endif () |