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 | fbf192a | 2017-12-11 15:56:08 -0800 | [diff] [blame] | 33 | 'mesa/program/prog_parameter.c', 'mesa/program/symbol_table.c', |
| 34 | 'mesa/program/dummy_errors.c', |
| 35 | ), |
Eric Engestrom | 79af307 | 2019-03-05 16:21:47 +0000 | [diff] [blame^] | 36 | include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 37 | c_args : [c_vis_args], |
| 38 | build_by_default : false, |
| 39 | ) |
| 40 | |
Eric Engestrom | 05a94a4 | 2017-10-24 18:03:39 +0100 | [diff] [blame] | 41 | sha1_h = custom_target( |
| 42 | 'git_sha1.h', |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 43 | output : 'git_sha1.h', |
Mathieu Bridon | 2ee1c86 | 2018-08-09 10:27:26 +0200 | [diff] [blame] | 44 | command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'], |
Eric Engestrom | 05a94a4 | 2017-10-24 18:03:39 +0100 | [diff] [blame] | 45 | build_always : true, # commit sha1 can change without having touched these files |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 46 | ) |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 47 | |
| 48 | subdir('gtest') |
Dylan Baker | f680cc6 | 2018-02-08 13:10:12 -0800 | [diff] [blame] | 49 | if cc.get_id() == 'msvc' |
| 50 | subdir('getopt') |
| 51 | else |
| 52 | idep_getopt = null_dep |
| 53 | endif |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 54 | subdir('util') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 55 | subdir('mapi') |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 56 | # TODO: opengl |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 57 | subdir('compiler') |
Eric Anholt | 82bf197 | 2018-09-25 19:15:45 -0700 | [diff] [blame] | 58 | if with_tools.contains('drm-shim') |
| 59 | subdir('drm-shim') |
| 60 | endif |
Samuel Pitoiset | d6db858 | 2019-11-22 12:16:50 +0100 | [diff] [blame] | 61 | if with_imgui |
| 62 | subdir('imgui') |
| 63 | endif |
Eric Engestrom | 4fa2fb3 | 2018-10-11 16:00:04 +0100 | [diff] [blame] | 64 | if with_platform_wayland |
| 65 | subdir('egl/wayland/wayland-drm') |
| 66 | endif |
Eric Engestrom | 3832db2 | 2018-10-11 16:21:14 +0100 | [diff] [blame] | 67 | if with_any_vk |
| 68 | subdir('vulkan') |
| 69 | endif |
Dylan Baker | 46a7fdd | 2017-11-13 11:16:28 -0800 | [diff] [blame] | 70 | if with_gallium_radeonsi or with_amd_vk |
| 71 | subdir('amd') |
| 72 | endif |
Eric Anholt | 34cefa7 | 2018-07-29 19:22:33 -0700 | [diff] [blame] | 73 | if with_gallium_vc4 or with_gallium_v3d |
Eric Anholt | 1ae8018 | 2017-10-12 13:53:12 -0700 | [diff] [blame] | 74 | subdir('broadcom') |
| 75 | endif |
Guido Günther | b921df3 | 2019-05-31 14:35:08 +0200 | [diff] [blame] | 76 | if with_gallium_etnaviv |
| 77 | subdir('etnaviv') |
| 78 | endif |
Bas Nieuwenhuizen | 26380b3 | 2018-08-08 22:23:57 +0000 | [diff] [blame] | 79 | if with_gallium_freedreno or with_freedreno_vk |
Rob Clark | b447613 | 2018-11-11 10:10:46 -0500 | [diff] [blame] | 80 | subdir('freedreno') |
| 81 | endif |
Alyssa Rosenzweig | 4132422 | 2019-06-18 11:16:21 -0700 | [diff] [blame] | 82 | if with_gallium_panfrost or with_gallium_lima |
| 83 | subdir('panfrost') |
| 84 | endif |
Kenneth Graunke | 2dce0e9 | 2017-11-23 23:15:14 -0800 | [diff] [blame] | 85 | if with_dri_i965 or with_intel_vk or with_gallium_iris |
Dylan Baker | 49fa074 | 2017-11-13 11:14:47 -0800 | [diff] [blame] | 86 | subdir('intel') |
| 87 | endif |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 88 | subdir('mesa') |
Dylan Baker | a47c525 | 2017-09-22 12:55:00 -0700 | [diff] [blame] | 89 | subdir('loader') |
Alexander von Gluck IV | 834d221 | 2018-02-16 16:56:31 -0600 | [diff] [blame] | 90 | if with_platform_haiku |
| 91 | subdir('hgl') |
| 92 | endif |
Emil Velikov | 9527f9e | 2018-12-12 17:47:36 +0000 | [diff] [blame] | 93 | if with_glx == 'dri' |
Alexander von Gluck IV | 834d221 | 2018-02-16 16:56:31 -0600 | [diff] [blame] | 94 | subdir('glx') |
| 95 | endif |
Dylan Baker | 816bf7d1 | 2017-09-28 15:53:53 -0700 | [diff] [blame] | 96 | if with_gbm |
| 97 | subdir('gbm') |
Dylan Baker | 5fcadae | 2018-01-03 12:33:55 -0800 | [diff] [blame] | 98 | else |
| 99 | inc_gbm = [] |
Dylan Baker | 816bf7d1 | 2017-09-28 15:53:53 -0700 | [diff] [blame] | 100 | endif |
Dylan Baker | 108d257 | 2017-10-18 12:20:43 -0700 | [diff] [blame] | 101 | if with_egl |
| 102 | subdir('egl') |
| 103 | endif |
Dylan Baker | 689fb74 | 2017-11-14 17:03:39 -0800 | [diff] [blame] | 104 | if with_gallium |
| 105 | subdir('gallium') |
Dylan Baker | 34cb4d0 | 2018-02-06 15:46:25 -0800 | [diff] [blame] | 106 | # This has to be here since it requires libgallium, and subdir cannot |
| 107 | # contain .. |
Dylan Baker | d84f003 | 2018-10-05 09:36:05 -0700 | [diff] [blame] | 108 | if with_tests and with_shared_glapi |
Dylan Baker | c73abb4 | 2018-04-18 09:29:35 -0700 | [diff] [blame] | 109 | subdir('mesa/state_tracker/tests') |
| 110 | endif |
Dylan Baker | 689fb74 | 2017-11-14 17:03:39 -0800 | [diff] [blame] | 111 | endif |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 112 | |
| 113 | # This must be after at least mesa, glx, and gallium, since libgl will be |
| 114 | # defined in one of those subdirs depending on the glx provider. |
Eric Engestrom | 6e21dcc | 2019-09-25 17:38:49 +0100 | [diff] [blame] | 115 | if with_glx != 'disabled' and not with_glvnd |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 116 | pkg.generate( |
| 117 | name : 'gl', |
| 118 | description : 'Mesa OpenGL Library', |
| 119 | version : meson.project_version(), |
Eric Engestrom | 6e21dcc | 2019-09-25 17:38:49 +0100 | [diff] [blame] | 120 | libraries : libgl, |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 121 | libraries_private : gl_priv_libs, |
| 122 | requires_private : gl_priv_reqs, |
| 123 | variables : ['glx_tls=yes'], |
| 124 | ) |
| 125 | endif |