1 2# Copyright(c) 2017 Intel Corporation 3 4# Permission is hereby granted, free of charge, to any person obtaining a 5# copy of this software and associated documentation files(the "Software"), 6# to deal in the Software without restriction, including without limitation 7# the rights to use, copy, modify, merge, publish, distribute, sublicense, 8# and / or sell copies of the Software, and to permit persons to whom the 9# Software is furnished to do so, subject to the following conditions: 10 11# The above copyright notice and this permission notice shall be included 12# in all copies or substantial portions of the Software. 13 14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20# OTHER DEALINGS IN THE SOFTWARE. 21 22 23cmake_minimum_required(VERSION 3.5) 24project(igfx_gmmumd) 25 26# GmmLib Api Version used for so naming 27set(GMMLIB_API_MAJOR_VERSION 12) 28set(GMMLIB_API_MINOR_VERSION 5) 29 30if(NOT DEFINED MAJOR_VERSION) 31 set(MAJOR_VERSION 12) 32endif() 33 34if(NOT DEFINED MINOR_VERSION) 35 set(MINOR_VERSION 5) 36endif() 37 38if(NOT DEFINED PATCH_VERSION) 39 set(PATCH_VERSION 0) 40endif() 41 42if(NOT DEFINED GMMLIB_API_PATCH_VERSION) 43 set(GMMLIB_API_PATCH_VERSION ${PATCH_VERSION}) 44endif() 45 46# The Gmmlib dll is generated as libigdgmm.so.<x>.<y>.<z> where, 47# <x> = GMMLIB_API_MAJOR_VERSION 48# <y> = GMMLIB_API_MINOR_VERSION 49# <z> = GMMLIB_API_PATCH_VERSION 50# 51# Example: libigdgmm.so.12.0.0 52# 12 = GMMLIB_API_MAJOR_VERSION 53# 0 = GMMLIB_API_MINOR_VERSION 54# 0 = GMMLIB_API_PATCH_VERSION 55# 56# Library version update 57# - increment major for any ABI change 58# - increment minor for any interface change (e.g. new/modified function) 59# 60# Example: 61# On potential ABI break changes 62# 63# libigdgmm.so.<GMMLIB_API_MAJOR_VERSION>.y.z becomes libigdgmm.so.<GMMLIB_API_MAJOR_VERSION + 1>.0.0 64# i.e libigdgmm.so.12.5.0 becomes libigdgmm.so.13.0.0 65 66message(STATUS "API version: ${GMMLIB_API_MAJOR_VERSION}.${GMMLIB_API_MINOR_VERSION}.${GMMLIB_API_PATCH_VERSION}") 67message(STATUS "Package version: ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") 68 69if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM) 70 if(DEFINED ENV{BS_USE_OSDM_BUILD_SYSTEM}) 71 set(BS_USE_OSDM_BUILD_SYSTEM "$ENV{BS_USE_OSDM_BUILD_SYSTEM}") 72 else() 73 set(BS_USE_OSDM_BUILD_SYSTEM FALSE) 74 endif() 75endif() 76 77# begin -- label bldsys file prologue 78# WARNING: The "project" statement triggers reading of CMAKE_TOOLCHAIN_FILE 79# and so must precede the inclusion below of bs_init.cmake . 80function(bs_find_build_system gfx_dev_dir build_sys_dir build_sys_inc) 81 # If we are not building as a standalone project 82 if(DEFINED GFX_DEVELOPMENT_DIR) 83 set(_bs_gfx_development_dir "${GFX_DEVELOPMENT_DIR}") 84 elseif(DEFINED ENV{GFX_DEVELOPMENT_DIR}) 85 set(_bs_gfx_development_dir "$ENV{GFX_DEVELOPMENT_DIR}") 86 else() 87 get_filename_component(_bs_cur_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) 88 get_filename_component(_bs_parent_dir "${_bs_cur_cmake_dir}" DIRECTORY) 89 set(_bs_gfx_dir_found false) 90 while(NOT _bs_gfx_dir_found) 91 set(_bs_bldsys_dir "${_bs_parent_dir}/Tools/bldsys") 92 if(EXISTS ${_bs_bldsys_dir}) 93 set(_bs_gfx_development_dir ${_bs_parent_dir}) 94 set(_bs_gfx_dir_found true) 95 break() 96 endif() 97 get_filename_component(_bs_parent_dir "${_bs_parent_dir}" DIRECTORY) 98 if(${_bs_parent_dir} STREQUAL "/") 99 break() 100 endif() 101 endwhile(NOT _bs_gfx_dir_found) 102 if (NOT _bs_gfx_development_dir) 103 message(FATAL_ERROR "GFX_DEVELOPMENT_DIR not found (${_bs_gfx_development_dir}) - exiting!") 104 exit(1) 105 endif() 106 endif() 107 set(${gfx_dev_dir} "${_bs_gfx_development_dir}" PARENT_SCOPE) 108 set(${build_sys_dir} "${_bs_gfx_development_dir}/Tools/bldsys" PARENT_SCOPE) 109 set(${build_sys_inc} "${_bs_gfx_development_dir}/Tools/bldsys/include" PARENT_SCOPE) 110endfunction(bs_find_build_system) 111 112bs_find_build_system(GFX_DEVELOPMENT_DIR BUILD_SYS_DIR BUILD_SYS_INC) 113 114include(${BUILD_SYS_DIR}/bs_init.cmake) 115include(${BUILD_SYS_INC}/bs_dir_names.cmake) 116# file prologue done 117 118 119set(CMAKE_DISABLE_SOURCE_CHANGES ON) 120set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) 121 122################################################################################ 123# Define GMM_DLL Target 124################################################################################ 125set (GMM_LIB_DLL_NAME igfx_gmmumd_dll) 126 127macro(GmmLibSetTargetConfig libTarget) 128 if(TARGET ${libTarget}) 129 set_property(TARGET ${libTarget} APPEND PROPERTY COMPILE_DEFINITIONS 130 $<$<CONFIG:Release>: _RELEASE> 131 $<$<CONFIG:ReleaseInternal>: _RELEASE_INTERNAL> 132 $<$<CONFIG:Debug>: _DEBUG> 133 ) 134 endif() 135endmacro() 136 137if(CMAKE_CONFIGURATION_TYPES) 138 set( CMAKE_CONFIGURATION_TYPES 139 "Debug" 140 "Release" 141 "ReleaseInternal") 142 143 set( CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING 144 "Reset the configurations to what we need" 145 FORCE) 146else() 147 if("${BUILD_TYPE}" STREQUAL "release") 148 set(CMAKE_BUILD_TYPE "Release") 149 elseif("${BUILD_TYPE}" STREQUAL "release-internal") 150 set(CMAKE_BUILD_TYPE "ReleaseInternal") 151 elseif("${BUILD_TYPE}" STREQUAL "debug") 152 set(CMAKE_BUILD_TYPE "Debug") 153 elseif("${BUILD_TYPE}" STREQUAL "RelWithDebInfo") 154 set(CMAKE_BUILD_TYPE "RelWithDebInfo") 155 elseif("${BUILD_TYPE}" STREQUAL "MinSizeRel") 156 set(CMAKE_BUILD_TYPE "MinSizeRel") 157 endif() 158 159endif() 160 161set(GMMLIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 162if(CMAKE_SIZEOF_VOID_P EQUAL 8) 163 set (GMMLIB_ARCH "64") 164else() 165 set (GMMLIB_ARCH "32") 166endif() 167 168if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch") 169 set(GMMLIB_MARCH "armv8-a+fp+simd") 170elseif("${GMMLIB_MARCH}" STREQUAL "") 171 set(GMMLIB_MARCH "corei7") 172endif() 173 174MESSAGE("platform: ${CMAKE_HOST_SYSTEM_NAME}") 175MESSAGE("source_dir: ${BS_DIR_GMMLIB}") 176MESSAGE("arch: ${GMMLIB_ARCH}") 177MESSAGE("build type: ${CMAKE_BUILD_TYPE}") 178MESSAGE("SourceConfiguration:") 179MESSAGE("CommonDir: ${BS_DIR_COMMON}") 180MESSAGE("IncDir: ${BS_DIR_INC}") 181 182# If '-DGMM_DYNAMIC_MOCS_TABLE=TRUE' (default is FALSE) passed to cmake 183# configure command gmmlib will generate MOCS table dynamically depending on 184# usage requests (Gen9). In this case on Linux user responsibility is to 185# make sure that generated MOCS table is programmed on KMD level. 186if (GMM_DYNAMIC_MOCS_TABLE) 187 MESSAGE("MOCS table: Dynamic") 188 add_definitions(-DGMM_DYNAMIC_MOCS_TABLE) 189else() 190 MESSAGE("MOCS table: Static") 191endif() 192 193if(DEFINED UFO_DRIVER_OPTIMIZATION_LEVEL) 194 if(${UFO_DRIVER_OPTIMIZATION_LEVEL} GREATER 0) 195 add_definitions(-DGMM_GFX_GEN=${GFXGEN}) 196 endif() 197endif() 198 199set(HEADERS_ 200 ${BS_DIR_GMMLIB}/CachePolicy/GmmCachePolicyConditionals.h 201 ${BS_DIR_GMMLIB}/CachePolicy/GmmCachePolicyResourceUsageDefinitions.h 202 ${BS_DIR_GMMLIB}/CachePolicy/GmmCachePolicyUndefineConditionals.h 203 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen10CachePolicy.h 204 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen11CachePolicy.h 205 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen12CachePolicy.h 206 ${BS_DIR_GMMLIB}/CachePolicy/GmmXe_LPGCachePolicy.h 207 ${BS_DIR_GMMLIB}/CachePolicy/GmmXe2_LPGCachePolicy.h 208 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen12dGPUCachePolicy.h 209 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen8CachePolicy.h 210 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen9CachePolicy.h 211 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen10.h 212 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen11.h 213 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen12.h 214 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyXe_LPG.h 215 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyXe2_LPG.h 216 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen12dGPU.h 217 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen8.h 218 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen9.h 219 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCachePolicy.h 220 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCachePolicyCommon.h 221 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCachePolicyExt.h 222 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCommonExt.h 223 ${BS_DIR_GMMLIB}/inc/External/Common/GmmConst.h 224 ${BS_DIR_GMMLIB}/inc/External/Common/GmmDebug.h 225 ${BS_DIR_GMMLIB}/inc/External/Common/GmmFormatTable.h 226 ${BS_DIR_GMMLIB}/inc/External/Common/GmmHw.h 227 ${BS_DIR_GMMLIB}/inc/External/Common/GmmInfo.h 228 ${BS_DIR_GMMLIB}/inc/External/Common/GmmInfoExt.h 229 ${BS_DIR_GMMLIB}/inc/External/Common/GmmInternal.h 230 ${BS_DIR_GMMLIB}/inc/External/Common/GmmMemAllocator.hpp 231 232 ${BS_DIR_GMMLIB}/inc/External/Common/GmmPlatformExt.h 233 ${BS_DIR_GMMLIB}/inc/External/Common/GmmProto.h 234 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceFlags.h 235 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceInfo.h 236 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceInfoCommon.h 237 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceInfoExt.h 238 ${BS_DIR_GMMLIB}/inc/External/Common/GmmTextureExt.h 239 ${BS_DIR_GMMLIB}/inc/External/Common/GmmUtil.h 240 ${BS_DIR_GMMLIB}/inc/External/Linux/GmmResourceInfoLin.h 241 ${BS_DIR_GMMLIB}/inc/External/Linux/GmmResourceInfoLinExt.h 242 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen10Platform.h 243 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen11Platform.h 244 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen12Platform.h 245 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen8Platform.h 246 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen9Platform.h 247 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen10TextureCalc.h 248 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen11TextureCalc.h 249 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen12TextureCalc.h 250 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmXe_LPGTextureCalc.h 251 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen7TextureCalc.h 252 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen8TextureCalc.h 253 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen9TextureCalc.h 254 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmTextureCalc.h 255 ${BS_DIR_GMMLIB}/inc/Internal/Common/GmmCommonInt.h 256 ${BS_DIR_GMMLIB}/inc/Internal/Common/GmmLibInc.h 257 ${BS_DIR_GMMLIB}/inc/GmmLib.h 258 ${BS_DIR_GMMLIB}/inc/Internal/Common/GmmLogger.h 259) 260 261set(UMD_HEADERS 262 ${HEADERS_} 263 ${BS_DIR_GMMLIB}/inc/External/Common/GmmPageTableMgr.h 264 ${BS_DIR_GMMLIB}/inc/External/Common/GmmClientContext.h 265 ${BS_DIR_GMMLIB}/inc/External/Common/GmmLibDll.h 266 ${BS_DIR_GMMLIB}/inc/External/Common/GmmLibDllName.h 267 ) 268 269 270set(SOURCES_ 271 ${BS_DIR_COMMON}/AssertTracer/AssertTracer.cpp 272 ${BS_DIR_GMMLIB}/CachePolicy/GmmCachePolicy.cpp 273 ${BS_DIR_GMMLIB}/CachePolicy/GmmCachePolicyCommon.cpp 274 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen8CachePolicy.cpp 275 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen9CachePolicy.cpp 276 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen10CachePolicy.cpp 277 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen11CachePolicy.cpp 278 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen12CachePolicy.cpp 279 ${BS_DIR_GMMLIB}/CachePolicy/GmmXe_LPGCachePolicy.cpp 280 ${BS_DIR_GMMLIB}/CachePolicy/GmmXe2_LPGCachePolicy.cpp 281 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen12dGPUCachePolicy.cpp 282 ${BS_DIR_GMMLIB}/Platform/GmmGen11Platform.cpp 283 ${BS_DIR_GMMLIB}/Platform/GmmGen12Platform.cpp 284 ${BS_DIR_GMMLIB}/Platform/GmmGen8Platform.cpp 285 ${BS_DIR_GMMLIB}/Platform/GmmGen9Platform.cpp 286 ${BS_DIR_GMMLIB}/Platform/GmmGen10Platform.cpp 287 ${BS_DIR_GMMLIB}/Platform/GmmPlatform.cpp 288 ${BS_DIR_GMMLIB}/Resource/GmmResourceInfo.cpp 289 ${BS_DIR_GMMLIB}/Resource/GmmResourceInfoCommon.cpp 290 ${BS_DIR_GMMLIB}/Resource/GmmResourceInfoCommonEx.cpp 291 ${BS_DIR_GMMLIB}/Resource/GmmRestrictions.cpp 292 ${BS_DIR_GMMLIB}/Resource/Linux/GmmResourceInfoLinCWrapper.cpp 293 ${BS_DIR_GMMLIB}/Texture/GmmGen7Texture.cpp 294 ${BS_DIR_GMMLIB}/Texture/GmmGen8Texture.cpp 295 ${BS_DIR_GMMLIB}/Texture/GmmGen9Texture.cpp 296 ${BS_DIR_GMMLIB}/Texture/GmmGen10Texture.cpp 297 ${BS_DIR_GMMLIB}/Texture/GmmGen11Texture.cpp 298 ${BS_DIR_GMMLIB}/Texture/GmmGen12Texture.cpp 299 ${BS_DIR_GMMLIB}/Texture/GmmXe_LPGTexture.cpp 300 ${BS_DIR_GMMLIB}/Texture/GmmTexture.cpp 301 ${BS_DIR_GMMLIB}/Texture/GmmTextureAlloc.cpp 302 ${BS_DIR_GMMLIB}/Texture/GmmTextureSpecialCases.cpp 303 ${BS_DIR_GMMLIB}/Texture/GmmTextureOffset.cpp 304 ${BS_DIR_GMMLIB}/GlobalInfo/GmmInfo.cpp 305 ${BS_DIR_GMMLIB}/Utility/CpuSwizzleBlt/CpuSwizzleBlt.c 306 ${BS_DIR_GMMLIB}/Utility/GmmLog/GmmLog.cpp 307 ${BS_DIR_GMMLIB}/Utility/GmmUtility.cpp 308) 309 310set(UMD_SOURCES 311 ${SOURCES_} 312 ${BS_DIR_GMMLIB}/TranslationTable/GmmAuxTable.cpp 313 ${BS_DIR_GMMLIB}/TranslationTable/GmmPageTableMgr.cpp 314 ${BS_DIR_GMMLIB}/TranslationTable/GmmUmdTranslationTable.cpp 315 ${BS_DIR_GMMLIB}/GlobalInfo/GmmClientContext.cpp 316 ${BS_DIR_GMMLIB}/GlobalInfo/GmmLibDllMain.cpp 317 ) 318 319source_group("Source Files\\Cache Policy\\Client Files" FILES 320 ${BS_DIR_GMMLIB}/CachePolicy/GmmCachePolicyResourceUsageDefinitions.h 321 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen10CachePolicy.h 322 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen11CachePolicy.h 323 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen12CachePolicy.h 324 ${BS_DIR_GMMLIB}/CachePolicy/GmmXe_LPGCachePolicy.h 325 ${BS_DIR_GMMLIB}/CachePolicy/GmmXe2_LPGCachePolicy.h 326 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen12dGPUCachePolicy.h 327 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen8CachePolicy.h 328 ${BS_DIR_GMMLIB}/CachePolicy/GmmGen9CachePolicy.h 329 ) 330 331source_group("Source Files\\Cache Policy" ${BS_DIR_GMMLIB}/CachePolicy/*.cpp) 332source_group("Source Files\\Global" ${BS_DIR_GMMLIB}/GlobalInfo/.*) 333source_group("Source Files\\Platform" ${BS_DIR_GMMLIB}/Platform/.*) 334source_group("Source Files\\Texture" ${BS_DIR_GMMLIB}/Texture/.*) 335source_group("Source Files\\Translation Table" ${BS_DIR_GMMLIB}/TranslationTable/.*) 336source_group("Source Files\\Utility" ${BS_DIR_GMMLIB}/Utility/.*) 337 338source_group("Source Files\\Resource" FILES 339 ${BS_DIR_GMMLIB}/Resource/GmmResourceInfo.cpp 340 ${BS_DIR_GMMLIB}/Resource/GmmResourceInfoCommon.cpp 341 ${BS_DIR_GMMLIB}/Resource/GmmResourceInfoCommonEx.cpp 342 ${BS_DIR_GMMLIB}/Resource/GmmRestrictions.cpp) 343 344source_group("Source Files\\Resource\\Linux" FILES 345 ${BS_DIR_GMMLIB}/Resource/Linux/GmmResourceInfoLinCWrapper.cpp 346 ) 347 348source_group("Source Files\\TranslationTable\\Windows" FILES 349 ${BS_DIR_GMMLIB}/TranslationTable/GmmAuxTable.cpp 350 ${BS_DIR_GMMLIB}/TranslationTable/GmmPageTableMgr.cpp 351 ${BS_DIR_GMMLIB}/TranslationTable/GmmUmdTranslationTable.cpp) 352 353source_group("Source Files\\TranslationTable" FILES 354 ${BS_DIR_GMMLIB}/TranslationTable/GmmUmdTranslationTable.h) 355 356source_group("Header Files\\External\\Common" FILES 357 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCachePolicy.h 358 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCachePolicyCommon.h 359 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCachePolicyExt.h 360 ${BS_DIR_GMMLIB}/inc/External/Common/GmmCommonExt.h 361 ${BS_DIR_GMMLIB}/inc/External/Common/GmmConst.h 362 ${BS_DIR_GMMLIB}/inc/External/Common/GmmDebug.h 363 ${BS_DIR_GMMLIB}/inc/External/Common/GmmFormatTable.h 364 ${BS_DIR_GMMLIB}/inc/External/Common/GmmHw.h 365 ${BS_DIR_GMMLIB}/inc/External/Common/GmmInfo.h 366 ${BS_DIR_GMMLIB}/inc/External/Common/GmmInfoExt.h 367 ${BS_DIR_GMMLIB}/inc/External/Common/GmmInternal.h 368 ${BS_DIR_GMMLIB}/inc/External/Common/GmmMemAllocator.hpp 369 ${BS_DIR_GMMLIB}/inc/External/Common/GmmPageTableMgr.h 370 ${BS_DIR_GMMLIB}/inc/External/Common/GmmPlatformExt.h 371 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceFlags.h 372 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceInfo.h 373 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceInfoCommon.h 374 ${BS_DIR_GMMLIB}/inc/External/Common/GmmResourceInfoExt.h 375 ${BS_DIR_GMMLIB}/inc/External/Common/GmmTextureExt.h 376 ${BS_DIR_GMMLIB}/inc/External/Common/GmmUtil.h 377 ${BS_DIR_GMMLIB}/inc/External/Common/GmmClientContext.h 378 ) 379 380source_group("Header Files" FILES 381 ${BS_DIR_GMMLIB}/inc/GmmLib.h 382 ) 383 384source_group("Header Files\\External\\Common\\Cache Policy" FILES 385 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen10.h 386 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen11.h 387 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen12.h 388 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyXe_LPG.h 389 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyXe2_LPG.h 390 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen12dGPU.h 391 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen8.h 392 ${BS_DIR_GMMLIB}/inc/External/Common/CachePolicy/GmmCachePolicyGen9.h 393 ) 394 395source_group("Header Files\\External\\Linux" FILES 396 ${BS_DIR_GMMLIB}/inc/External/Linux/GmmResourceInfoLin.h 397 ${BS_DIR_GMMLIB}/inc/External/Linux/GmmResourceInfoLinExt.h 398 ) 399 400source_group("Header Files\\Internal\\Common" FILES 401 ${BS_DIR_GMMLIB}/inc/Internal/Common/GmmLibInc.h 402 ${BS_DIR_GMMLIB}/inc/Internal/Common/GmmProto.h 403 ) 404 405source_group("Header Files\\Internal\\Common\\Platform" FILES 406 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen10Platform.h 407 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen11Platform.h 408 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen12Platform.h 409 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen8Platform.h 410 ${BS_DIR_GMMLIB}/inc/Internal/Common/Platform/GmmGen9Platform.h 411 ) 412 413source_group("Header Files\\Internal\\Common\\Texture" FILES 414 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen10TextureCalc.h 415 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen11TextureCalc.h 416 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen12TextureCalc.h 417 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmXe_LPGTextureCalc.h 418 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen7TextureCalc.h 419 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen8TextureCalc.h 420 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmGen9TextureCalc.h 421 ${BS_DIR_GMMLIB}/inc/Internal/Common/Texture/GmmTextureCalc.h 422 ) 423 424include_directories(BEFORE ${BS_DIR_GMMLIB}/) 425 426include_directories(BEFORE ${PROJECT_SOURCE_DIR}) 427 428 429 include_directories( 430 ${BS_DIR_GMMLIB} 431 ${BS_DIR_GMMLIB}/Utility/GmmLog 432 ${BS_DIR_GMMLIB}/inc 433 ${BS_DIR_GMMLIB}/Utility 434 ${BS_DIR_GMMLIB}/GlobalInfo 435 ${BS_DIR_GMMLIB}/Texture 436 ${BS_DIR_GMMLIB}/Resource 437 ${BS_DIR_GMMLIB}/Platform 438 ${BS_DIR_UTIL} 439 ${BS_DIR_INC} 440 ${BS_DIR_INC}/common 441 ${BS_DIR_INC}/umKmInc 442 ) 443 444if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch") 445 include_directories(${GFX_DEVELOPMENT_DIR}/third_party/sse2neon) 446endif() 447 448set(headers 449 ${HEADERS_} 450) 451 452 set(SOURCES 453 ${SOURCES_} 454 ) 455 456# set compiler options 457include(Linux.cmake) 458 459################################################################################### 460# create dll library 461################################################################################### 462add_library( ${GMM_LIB_DLL_NAME} SHARED igdgmm.rc ${UMD_SOURCES} ${UMD_HEADERS}) 463 464GmmLibSetTargetConfig(${GMM_LIB_DLL_NAME}) 465 466if(MSVC) 467 468set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES OUTPUT_NAME "igdgmm${GMMLIB_ARCH}") 469 470bs_set_wdk(${GMM_LIB_DLL_NAME}) 471 472set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VS_GLOBAL_DriverTargetPlatform Universal) 473set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VS_PLATFORM_TOOLSET WindowsApplicationForDrivers10.0) 474windows_umd_props_universal(${GMM_LIB_DLL_NAME}) 475 476target_link_libraries( ${GMM_LIB_DLL_NAME} 477 onecoreuap.lib 478 ) 479else() 480 set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES OUTPUT_NAME "igdgmm") 481 set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VERSION ${GMMLIB_API_MAJOR_VERSION}.${GMMLIB_API_MINOR_VERSION}.${GMMLIB_API_PATCH_VERSION}) 482 set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES SOVERSION ${GMMLIB_API_MAJOR_VERSION}) 483 set(THREADS_PREFER_PTHREAD_FLAG ON) 484 find_package(Threads REQUIRED) 485 target_link_libraries(${GMM_LIB_DLL_NAME} Threads::Threads) 486 487endif() 488 489 490################################################################################### 491# End of DLL create library 492################################################################################### 493 494bs_set_defines() 495bs_set_force_exceptions() 496bs_set_post_target() 497 498################################################################################### 499# Set common macros for DLL 500################################################################################### 501bs_set_extra_target_properties(${GMM_LIB_DLL_NAME} 502 _ATL_NO_WIN_SUPPORT 503 SMALL_POOL_ALLOC 504 __GMM 505 __GFX_MACRO_C__ 506 UNUSED_ISTDLIB_MT 507 __UMD 508 GMM_UNIFY_DAF_API 509 ) 510 511if(CMAKE_BUILD_TYPE STREQUAL "ReleaseInternal") 512 bs_set_extra_target_properties(${GMM_LIB_DLL_NAME} _RELEASE_INTERNAL) 513endif() 514 515target_include_directories(${GMM_LIB_DLL_NAME} INTERFACE 516 ${BS_DIR_GMMLIB}/inc 517 ${BS_DIR_INC} 518 ${BS_DIR_INC}/common) 519 520################################################################################### 521# End of Set macros DLL 522################################################################################### 523 524bs_set_extra_target_properties(${GMM_LIB_DLL_NAME} 525 ISTDLIB_UMD 526 UNUSED_ISTDLIB_MT 527 GMM_UNIFIED_LIB 528 GMM_LIB_DLL 529 GMM_LIB_DLL_EXPORTS 530) 531 532if("${GMMLIB_ARCH}" MATCHES "64") 533 bs_set_extra_target_properties(${GMM_LIB_DLL_NAME} 534 _X64) 535endif() 536 537if(NOT DEFINED RUN_TEST_SUITE OR RUN_TEST_SUITE) 538 add_subdirectory(ULT) 539endif() 540 541set (GMM_UMD_DLL "igdgmm") 542 543include(os_release_info.cmake) 544 545get_os_release_info(os_name os_version) 546 547if("${os_name}" STREQUAL "clear-linux-os") 548 # clear-linux-os distribution avoids /etc for distribution defaults. 549 # Set this variable explicitly before including GNUInstallDirs. 550 set(CMAKE_INSTALL_SYSCONFDIR "usr/share/defaults/etc") 551endif() 552 553if(UNIX) 554 include(GNUInstallDirs) 555 556 configure_file(${BS_DIR_GMMLIB}/igdgmm.h.in ${CMAKE_BINARY_DIR}/igdgmm.h) 557 configure_file(${BS_DIR_GMMLIB}/igdgmm.pc.in ${CMAKE_BINARY_DIR}/igdgmm.pc @ONLY) 558 559 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/postinst "/sbin/ldconfig\n") 560 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/postrm "/sbin/ldconfig\n") 561 file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/postinst DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) 562 file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/postrm DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) 563 564 install(TARGETS ${GMM_LIB_DLL_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT gmmlib NAMELINK_SKIP) 565 install(TARGETS ${GMM_LIB_DLL_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT gmmlib-devel NAMELINK_ONLY) 566 567 install(DIRECTORY ${BS_DIR_GMMLIB} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igdgmm COMPONENT gmmlib-devel 568 FILES_MATCHING PATTERN "*.h" 569 PATTERN "*.hpp" 570 PATTERN "Internal" EXCLUDE 571 PATTERN "ULT" EXCLUDE 572 PATTERN "spdlog" EXCLUDE) 573 574 install (DIRECTORY ${BS_DIR_INC} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igdgmm COMPONENT gmmlib-devel 575 FILES_MATCHING PATTERN "*.h" 576 PATTERN "*.hpp") 577 578 install (DIRECTORY ${BS_DIR_UTIL} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igdgmm COMPONENT gmmlib-devel 579 FILES_MATCHING PATTERN "*.h" 580 PATTERN "*.hpp") 581 582 install (FILES ${BS_DIR_GMMLIB}/Utility/CpuSwizzleBlt/CpuSwizzleBlt.c 583 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igdgmm/GmmLib/Utility/CpuSwizzleBlt/ COMPONENT gmmlib-devel) 584 585 install(FILES ${CMAKE_BINARY_DIR}/igdgmm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT gmmlib-devel) 586 install(FILES ${CMAKE_BINARY_DIR}/igdgmm.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igdgmm COMPONENT gmmlib-devel) 587 588 if(GMMLIB_CPACK_GENERATOR) 589 set(CPACK_GENERATOR "${GMMLIB_CPACK_GENERATOR}") 590 else() 591 # If generators list was not define build native package for current distro 592 if(EXISTS "/etc/debian_version") 593 set(CPACK_GENERATOR "DEB") 594 elseif(EXISTS "/etc/redhat-release") 595 set(CPACK_GENERATOR "RPM") 596 else() 597 set(CPACK_GENERATOR "TXZ") 598 endif() 599 endif() 600 601 set(CPACK_PACKAGE_NAME "intel") 602 set(CPACK_PACKAGE_VENDOR "Intel Corporation") 603 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Intel(R) Graphics Memory Management Library Package") 604 set(CPACK_PACKAGE_ARCHITECTURE "x86_64") 605 606 set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION}) 607 set(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION}) 608 set(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION}) 609 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") 610 611 set(CPACK_PACKAGE_INSTALL_DIRECTORY ${GMMLIB_INSTALL_TIME_ROOT_DIR}) 612 set(CPACK_SET_DESTDIR TRUE) 613 set(CPACK_PACKAGE_RELOCATABLE FALSE) 614 615 set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") 616 set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel") 617 set(CPACK_DEBIAN_COMPRESSION_TYPE "xz") 618 set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/postinst;${CMAKE_CURRENT_BINARY_DIR}/postrm") 619 620 set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64") 621 set(CPACK_RPM_PACKAGE_RELEASE 1) 622 set(CPACK_RPM_COMPRESSION_TYPE "xz") 623 set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst") 624 set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postrm") 625 626 if(CMAKE_VERSION VERSION_GREATER 3.6 OR CMAKE_VERSION VERSION_EQUAL 3.6) 627 set(CPACK_DEBIAN_GMMLIB_FILE_NAME "intel-gmmlib_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") 628 set(CPACK_DEBIAN_GMMLIB-DEVEL_FILE_NAME "intel-gmmlib-devel_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") 629 630 set(CPACK_RPM_GMMLIB_FILE_NAME "intel-gmmlib-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm") 631 set(CPACK_RPM_GMMLIB-DEVEL_FILE_NAME "intel-gmmlib-devel-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm") 632 633 set(CPACK_ARCHIVE_GMMLIB_FILE_NAME "intel-gmmlib-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCHITECTURE}") 634 set(CPACK_ARCHIVE_GMMLIB-DEVEL_FILE_NAME "intel-gmmlib-devel-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCHITECTURE}") 635 else() 636 if(CPACK_GENERATOR STREQUAL "DEB") 637 set(CPACK_PACKAGE_FILE_NAME "intel-gmmlib_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") 638 elseif(CPACK_GENERATOR STREQUAL "RPM") 639 set(CPACK_PACKAGE_FILE_NAME "intel-gmmlib-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm") 640 else() 641 set(CPACK_PACKAGE_FILE_NAME "intel-gmmlib-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCHITECTURE}") 642 endif() 643 endif() 644 645 set(CPACK_DEBIAN_GMMLIB-DEVEL_PACKAGE_DEPENDS "intel-gmmlib(=${CPACK_PACKAGE_VERSION})") 646 set(CPACK_RPM_GMMLIB-DEVEL_PACKAGE_REQUIRES "intel-gmmlib = ${CPACK_PACKAGE_VERSION}") 647 648 set(CPACK_COMPONENT_INSTALL ON) 649 set(CPACK_DEB_COMPONENT_INSTALL ON) 650 set(CPACK_RPM_COMPONENT_INSTALL ON) 651 set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) 652 set(CPACK_COMPONENTS_ALL gmmlib gmmlib-devel) 653 654 include (CPack) 655 656endif() 657