File: FindInternals.cmake

package info (click to toggle)
onevpl-intel-gpu 26.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,920 kB
  • sloc: cpp: 1,444,019; ansic: 29,778; asm: 17,754; makefile: 6
file content (158 lines) | stat: -rw-r--r-- 4,675 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Copyright (c) 2012-2021 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

if(NOT DEFINED BUILDER_ROOT)
  set( BUILDER_ROOT ${CMAKE_HOME_DIRECTORY}/builder )
endif()

get_filename_component( MSDK_BUILD_ROOT_MINUS_ONE "${BUILDER_ROOT}/.." ABSOLUTE )

set( MSDK_STUDIO_ROOT  ${MSDK_BUILD_ROOT_MINUS_ONE}/_studio )
set( MSDK_TSUITE_ROOT  ${MSDK_BUILD_ROOT_MINUS_ONE}/_testsuite )
set( MSDK_LIB_ROOT     ${MSDK_STUDIO_ROOT}/mfx_lib )
set( MSDK_UMC_ROOT     ${MSDK_STUDIO_ROOT}/shared/umc )
set( MSDK_SAMPLES_ROOT ${MSDK_BUILD_ROOT_MINUS_ONE}/samples )
set( MSDK_TOOLS_ROOT   ${MSDK_BUILD_ROOT_MINUS_ONE}/tools )
set( MSDK_BUILDER_ROOT ${BUILDER_ROOT} )
set( MSDK_CMAKE_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR} )

#================================================

add_library(mfx_static_lib INTERFACE)
target_include_directories(mfx_static_lib
  INTERFACE
    ${MFX_API_HOME}/include
    ${MSDK_STUDIO_ROOT}/shared/include
    ${MSDK_LIB_ROOT}/shared/include
    )

target_compile_definitions(mfx_static_lib
  INTERFACE
    ${API_FLAGS}
    MFX_DEPRECATED_OFF
    ${WARNING_FLAGS}
  )

target_link_libraries(mfx_static_lib
  INTERFACE
    mfx_common_properties
    $<$<PLATFORM_ID:Linux>:va>  #fixme: break down to real dependencies
  )

target_link_libraries(mfx_static_lib
  INTERFACE
    ipp
)

#================================================

add_library(mfx_shared_lib INTERFACE)
target_link_options(mfx_shared_lib
  INTERFACE
    # $<$<PLATFORM_ID:Windows>:/NODEFAULTLIB:libcmtd.lib>
    $<$<AND:$<PLATFORM_ID:Windows>,$<CONFIG:Debug>>:/NODEFAULTLIB:libcpmt.lib>
    $<$<PLATFORM_ID:Windows>:
      /DEBUG
      /PDB:$<TARGET_PDB_FILE_DIR:$<TARGET_PROPERTY:NAME>>/$<TARGET_PROPERTY:NAME>.pdb
    >
  )

  target_link_options(mfx_shared_lib
    INTERFACE
      $<$<PLATFORM_ID:Linux>:LINKER:--no-undefined,-z,relro,-z,now,-z,noexecstack>
    )

target_link_libraries(mfx_shared_lib
  INTERFACE
    $<$<PLATFORM_ID:Windows>:
      dxva2.lib
      D3D11.lib
      DXGI.lib
      d3d9.lib
      d3d12.lib
      >
    mfx_common_properties
    ${CMAKE_DL_LIBS}
  )

target_compile_definitions(mfx_shared_lib
  INTERFACE
    ${API_FLAGS}
  )

add_library(mfx_sdl_properties INTERFACE)

target_compile_options(mfx_sdl_properties
  INTERFACE
    $<$<CXX_COMPILER_ID:MSVC>:
      /WX
      /W4
      /sdl
      /wd5105  # macro expands to defined(smth)
      /wd4061  # not all enum members listed in case, but default found
      /wd4710  # no inline for inline function
      /wd4668  # replacing undefined macro with 0
      /wd4201  # unnamed unions in headers
      /wd4711  # inlining of non-marked function
      >
  )
#================================================

add_library(mfx_plugin_properties INTERFACE)

target_link_options(mfx_plugin_properties
  INTERFACE
    $<$<PLATFORM_ID:Windows>: LINKER:/DEF:${MSDK_STUDIO_ROOT}/mfx_lib/plugin/libmfxsw_plugin.def>
    $<$<PLATFORM_ID:Linux>: LINKER:--version-script=${MSDK_STUDIO_ROOT}/mfx_lib/plugin/libmfxsw_plugin.map>
  )

target_link_libraries(mfx_plugin_properties
  INTERFACE
    umc_va_hw
    Threads::Threads
    ${CMAKE_DL_LIBS}
)

#================================================

add_library(mfx_va_properties INTERFACE) # va stands for video acceleration 

  target_link_options(mfx_va_properties
    INTERFACE
      $<$<PLATFORM_ID:Linux>:LINKER:--no-undefined,-z,relro,-z,now,-z,noexecstack>
    )

target_link_libraries(mfx_va_properties
  INTERFACE
    $<$<PLATFORM_ID:Linux>:va>
    Threads::Threads
    ${CMAKE_DL_LIBS}
)

target_compile_definitions(mfx_va_properties
  INTERFACE
    MFX_VA
    $<$<PLATFORM_ID:Linux>:
      LIBVA_SUPPORT
      LIBVA_DRM_SUPPORT
    >
)