xref: /aosp_15_r20/external/gmmlib/Tools/bldsys/bs_init.cmake (revision 35ffd701415c9e32e53136d61a677a8d0a8fc4a5)
1# Copyright(c) 2017 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
21
22if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM)
23    if(DEFINED ENV{BS_USE_OSDM_BUILD_SYSTEM})
24        set(BS_USE_OSDM_BUILD_SYSTEM "$ENV{BS_USE_OSDM_BUILD_SYSTEM}")
25    else()
26        set(BS_USE_OSDM_BUILD_SYSTEM TRUE)
27    endif()
28endif()
29
30
31include(${BUILD_SYS_INC}/bs_base_utils.cmake)
32
33bs_check_build_type()
34
35if(DEFINED UFO_ANDROID_VERSION)
36    add_definition(-DANDROID_VERSION=${UFO_ANDROID_VERSION})
37elseif(DEFINED ENV{UFO_ANDROID_VERSION})
38    add_definition(-DANDROID_VERSION=$ENV{UFO_ANDROID_VERSION})
39endif()
40
41# Ensure definitions for some variables that should be set by the overall build system.
42bs_set_if_undefined(PLATFORM "linux")
43bs_set_if_undefined(GFXGEN "9")
44bs_set_if_undefined(CXXFLAGS "-D_GLIBCXX_USE_CXX11_ABI=0")
45
46# Other useful definitions
47bs_set_if_undefined(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
48bs_set_if_undefined(CMAKE_VERBOSE_MAKEFILE "1")
49
50## bs_set_if_undefined(UFO_CMAKE_DEBUG "ON")
51## bs_set_if_undefined(BUILD_VERSION_STRING "9999")
52
53
54include(${BUILD_SYS_INC}/bs_dir_names.cmake)
55
56# Needed for bs_add_some_common_includes
57include(${BUILD_SYS_INC}/utils.cmake)
58
59if(BS_USE_OSDM_BUILD_SYSTEM)
60
61include(${BUILD_SYS_INC}/stdvars.cmake)
62
63include(${BUILD_SYS_DIR}/build_sys.cmake)
64
65bs_set_base_flags()
66
67endif(BS_USE_OSDM_BUILD_SYSTEM)
68