Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 1 | # Copyright © 2017 Intel Corporation |
| 2 | |
| 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | # of this software and associated documentation files (the "Software"), to deal |
| 5 | # in the Software without restriction, including without limitation the rights |
| 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | # copies of the Software, and to permit persons to whom the Software is |
| 8 | # furnished to do so, subject to the following conditions: |
| 9 | |
| 10 | # The above copyright notice and this permission notice shall be included in |
| 11 | # all copies or substantial portions of the Software. |
| 12 | |
| 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 19 | # SOFTWARE. |
| 20 | |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 21 | inc_mesa = include_directories('mesa') |
| 22 | inc_mapi = include_directories('mapi') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 23 | inc_src = include_directories('.') |
Dylan Baker | 06c6675 | 2017-10-20 22:23:15 -0700 | [diff] [blame] | 24 | inc_gallium = include_directories('gallium/include') |
| 25 | inc_gallium_aux = include_directories('gallium/auxiliary') |
Dylan Baker | 5060c51 | 2017-10-25 18:55:38 -0700 | [diff] [blame] | 26 | inc_amd_common = include_directories('amd/common') |
Timur Kristóf | 3a08110 | 2019-09-27 10:29:51 +0200 | [diff] [blame] | 27 | inc_amd_common_llvm = include_directories('amd/llvm') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 28 | |
| 29 | libglsl_util = static_library( |
| 30 | 'glsl_util', |
Dylan Baker | fbf192a | 2017-12-11 15:56:08 -0800 | [diff] [blame] | 31 | files( |
Marek Olšák | e5339fe | 2020-03-25 21:11:44 -0400 | [diff] [blame] | 32 | 'mesa/main/extensions_table.c', |
Dylan Baker | 8e36961 | 2018-09-14 12:57:32 -0700 | [diff] [blame] | 33 | 'mesa/program/prog_parameter.c', |
| 34 | 'mesa/program/symbol_table.c', |
Dylan Baker | fbf192a | 2017-12-11 15:56:08 -0800 | [diff] [blame] | 35 | 'mesa/program/dummy_errors.c', |
| 36 | ), |
Eric Engestrom | 79af307 | 2019-03-05 16:21:47 +0000 | [diff] [blame] | 37 | include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], |
Dylan Baker | a8e2d79 | 2020-04-24 13:10:41 -0700 | [diff] [blame] | 38 | gnu_symbol_visibility : 'hidden', |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 39 | build_by_default : false, |
| 40 | ) |
| 41 | |
Eric Engestrom | 05a94a4 | 2017-10-24 18:03:39 +0100 | [diff] [blame] | 42 | sha1_h = custom_target( |
| 43 | 'git_sha1.h', |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 44 | output : 'git_sha1.h', |
Mathieu Bridon | 2ee1c86 | 2018-08-09 10:27:26 +0200 | [diff] [blame] | 45 | command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'], |
Dylan Baker | 6ef314b | 2020-04-24 12:29:42 -0700 | [diff] [blame] | 46 | build_by_default : true, |
| 47 | build_always_stale : true, # commit sha1 can change without having touched these files |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 48 | ) |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 49 | |
| 50 | subdir('gtest') |
Dylan Baker | f680cc6 | 2018-02-08 13:10:12 -0800 | [diff] [blame] | 51 | if cc.get_id() == 'msvc' |
| 52 | subdir('getopt') |
| 53 | else |
| 54 | idep_getopt = null_dep |
| 55 | endif |
Kristian H. Kristensen | 932f51d | 2020-07-28 15:25:49 -0700 | [diff] [blame] | 56 | subdir('android_stub') |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 57 | subdir('util') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 58 | subdir('mapi') |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 59 | # TODO: opengl |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 60 | subdir('compiler') |
Eric Anholt | 82bf197 | 2018-09-25 19:15:45 -0700 | [diff] [blame] | 61 | if with_tools.contains('drm-shim') |
| 62 | subdir('drm-shim') |
| 63 | endif |
Samuel Pitoiset | d6db858 | 2019-11-22 12:16:50 +0100 | [diff] [blame] | 64 | if with_imgui |
| 65 | subdir('imgui') |
| 66 | endif |
Eric Engestrom | 4fa2fb3 | 2018-10-11 16:00:04 +0100 | [diff] [blame] | 67 | if with_platform_wayland |
| 68 | subdir('egl/wayland/wayland-drm') |
| 69 | endif |
Eric Engestrom | 3832db2 | 2018-10-11 16:21:14 +0100 | [diff] [blame] | 70 | if with_any_vk |
| 71 | subdir('vulkan') |
| 72 | endif |
Dylan Baker | 46a7fdd | 2017-11-13 11:16:28 -0800 | [diff] [blame] | 73 | if with_gallium_radeonsi or with_amd_vk |
| 74 | subdir('amd') |
| 75 | endif |
Eric Anholt | 34cefa7 | 2018-07-29 19:22:33 -0700 | [diff] [blame] | 76 | if with_gallium_vc4 or with_gallium_v3d |
Eric Anholt | 1ae8018 | 2017-10-12 13:53:12 -0700 | [diff] [blame] | 77 | subdir('broadcom') |
| 78 | endif |
Guido Günther | b921df3 | 2019-05-31 14:35:08 +0200 | [diff] [blame] | 79 | if with_gallium_etnaviv |
| 80 | subdir('etnaviv') |
| 81 | endif |
Bas Nieuwenhuizen | 26380b3 | 2018-08-08 22:23:57 +0000 | [diff] [blame] | 82 | if with_gallium_freedreno or with_freedreno_vk |
Rob Clark | b447613 | 2018-11-11 10:10:46 -0500 | [diff] [blame] | 83 | subdir('freedreno') |
| 84 | endif |
Alyssa Rosenzweig | 4132422 | 2019-06-18 11:16:21 -0700 | [diff] [blame] | 85 | if with_gallium_panfrost or with_gallium_lima |
| 86 | subdir('panfrost') |
| 87 | endif |
Chia-I Wu | 42e29fe | 2020-07-02 11:06:15 -0700 | [diff] [blame] | 88 | if with_gallium_virgl |
| 89 | subdir('virtio') |
| 90 | endif |
Kenneth Graunke | 2dce0e9 | 2017-11-23 23:15:14 -0800 | [diff] [blame] | 91 | if with_dri_i965 or with_intel_vk or with_gallium_iris |
Dylan Baker | 49fa074 | 2017-11-13 11:14:47 -0800 | [diff] [blame] | 92 | subdir('intel') |
| 93 | endif |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 94 | subdir('mesa') |
Dylan Baker | a47c525 | 2017-09-22 12:55:00 -0700 | [diff] [blame] | 95 | subdir('loader') |
Alexander von Gluck IV | 834d221 | 2018-02-16 16:56:31 -0600 | [diff] [blame] | 96 | if with_platform_haiku |
| 97 | subdir('hgl') |
| 98 | endif |
Emil Velikov | 9527f9e | 2018-12-12 17:47:36 +0000 | [diff] [blame] | 99 | if with_glx == 'dri' |
Alexander von Gluck IV | 834d221 | 2018-02-16 16:56:31 -0600 | [diff] [blame] | 100 | subdir('glx') |
| 101 | endif |
Dylan Baker | 816bf7d1 | 2017-09-28 15:53:53 -0700 | [diff] [blame] | 102 | if with_gbm |
| 103 | subdir('gbm') |
Dylan Baker | 5fcadae | 2018-01-03 12:33:55 -0800 | [diff] [blame] | 104 | else |
| 105 | inc_gbm = [] |
Dylan Baker | 816bf7d1 | 2017-09-28 15:53:53 -0700 | [diff] [blame] | 106 | endif |
Dylan Baker | 108d257 | 2017-10-18 12:20:43 -0700 | [diff] [blame] | 107 | if with_egl |
| 108 | subdir('egl') |
| 109 | endif |
Dylan Baker | 689fb74 | 2017-11-14 17:03:39 -0800 | [diff] [blame] | 110 | if with_gallium |
| 111 | subdir('gallium') |
Dylan Baker | 34cb4d0 | 2018-02-06 15:46:25 -0800 | [diff] [blame] | 112 | # This has to be here since it requires libgallium, and subdir cannot |
| 113 | # contain .. |
Dylan Baker | d84f003 | 2018-10-05 09:36:05 -0700 | [diff] [blame] | 114 | if with_tests and with_shared_glapi |
Dylan Baker | c73abb4 | 2018-04-18 09:29:35 -0700 | [diff] [blame] | 115 | subdir('mesa/state_tracker/tests') |
| 116 | endif |
Dylan Baker | 689fb74 | 2017-11-14 17:03:39 -0800 | [diff] [blame] | 117 | endif |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 118 | |
| 119 | # This must be after at least mesa, glx, and gallium, since libgl will be |
| 120 | # defined in one of those subdirs depending on the glx provider. |
Eric Engestrom | 6e21dcc | 2019-09-25 17:38:49 +0100 | [diff] [blame] | 121 | if with_glx != 'disabled' and not with_glvnd |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 122 | pkg.generate( |
| 123 | name : 'gl', |
| 124 | description : 'Mesa OpenGL Library', |
| 125 | version : meson.project_version(), |
Eric Engestrom | 6e21dcc | 2019-09-25 17:38:49 +0100 | [diff] [blame] | 126 | libraries : libgl, |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 127 | libraries_private : gl_priv_libs, |
| 128 | requires_private : gl_priv_reqs, |
Eric Engestrom | 9ac1686 | 2019-11-21 22:14:50 +0000 | [diff] [blame] | 129 | variables : ['glx_tls=@0@'.format(use_elf_tls ? 'yes' : 'no')], |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 130 | ) |
| 131 | endif |