Debian Codegraph @

media_driver/linux/ult/CMakeLists.txt

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 # Copyright (c) 2018, Intel Corporation
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice shall be included
11 # in all copies or substantial portions of the Software.
12 #
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
17 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19 # OTHER DEALINGS IN THE SOFTWARE.
20 cmake_minimum_required(VERSION 3.1)
21
22 if ("${BUILD_TYPE}" STREQUAL "debug")
23 set(CMAKE_BUILD_TYPE "Debug")
24 add_definitions(-D_DEBUG)
25 elseif ("${BUILD_TYPE}" STREQUAL "release-internal")
26 set(CMAKE_BUILD_TYPE "ReleaseInternal")
27 add_definitions(-D_RELEASE_INTERNAL)
28 else ()
29 if (NOT "${BUILD_TYPE}" STREQUAL "release")
30 message("-- devult -- No valid build type specified, set to release as default")
31 endif ()
32 set(CMAKE_BUILD_TYPE "Release")
33 add_definitions(-D_RELEASE)
34 endif ()
35
36 #-fno-plt is a GCC option to disable the use of PLT for external function calls in position-independent code.
37 #This option is by default enabled on some Linux distributions such as Arch Linux, which can cause link error.
38 string(REPLACE "-fno-plt" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
39
40 if (NOT "${LIBVA_INSTALL_PATH}" STREQUAL "")
41 include_directories(BEFORE ${LIBVA_INSTALL_PATH})
42 elseif (DEFINED ENV{LIBVA_INSTALL_PATH} AND NOT "$ENV{LIBVA_INSTALL_PATH}" STREQUAL "")
43 include_directories(BEFORE $ENV{LIBVA_INSTALL_PATH})
44 else ()
45 include(FindPkgConfig)
46 pkg_check_modules(LIBVA REQUIRED libva>=1.8.0)
47 if (LIBVA_FOUND)
48 include_directories(BEFORE ${LIBVA_INCLUDE_DIRS})
49 endif ()
50 endif ()
51
52 add_subdirectory(libdrm_mock)
53 add_subdirectory(ult_app)
54
55 enable_testing()
56 add_test(NAME test_devult COMMAND devult ${UMD_PATH})
57 set_tests_properties(test_devult
58 PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
59 set_tests_properties(test_devult
60 PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")