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_common = include_directories( |
| 22 | '../include', '.', 'mapi', 'mesa', 'gallium/include', 'gallium/auxiliary') |
| 23 | inc_mesa = include_directories('mesa') |
| 24 | inc_mapi = include_directories('mapi') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 25 | inc_src = include_directories('.') |
Dylan Baker | 06c6675 | 2017-10-20 22:23:15 -0700 | [diff] [blame] | 26 | inc_gallium = include_directories('gallium/include') |
| 27 | inc_gallium_aux = include_directories('gallium/auxiliary') |
Dylan Baker | 5060c51 | 2017-10-25 18:55:38 -0700 | [diff] [blame] | 28 | inc_amd_common = include_directories('amd/common') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 29 | |
| 30 | libglsl_util = static_library( |
| 31 | 'glsl_util', |
Dylan Baker | fbf192a | 2017-12-11 15:56:08 -0800 | [diff] [blame] | 32 | files( |
| 33 | 'mesa/main/extensions_table.c', 'mesa/main/imports.c', |
| 34 | 'mesa/program/prog_parameter.c', 'mesa/program/symbol_table.c', |
| 35 | 'mesa/program/dummy_errors.c', |
| 36 | ), |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 37 | include_directories : [inc_common], |
| 38 | c_args : [c_vis_args], |
| 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@'], |
Eric Engestrom | 05a94a4 | 2017-10-24 18:03:39 +0100 | [diff] [blame] | 46 | build_always : true, # commit sha1 can change without having touched these files |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 47 | ) |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 48 | |
| 49 | subdir('gtest') |
| 50 | subdir('util') |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 51 | subdir('mapi') |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 52 | # TODO: opengl |
Dylan Baker | d199225 | 2017-09-14 17:57:17 -0700 | [diff] [blame] | 53 | subdir('compiler') |
| 54 | subdir('egl/wayland/wayland-drm') |
Eric Engestrom | 3832db2 | 2018-10-11 16:21:14 +0100 | [diff] [blame^] | 55 | if with_any_vk |
| 56 | subdir('vulkan') |
| 57 | endif |
Dylan Baker | 46a7fdd | 2017-11-13 11:16:28 -0800 | [diff] [blame] | 58 | if with_gallium_radeonsi or with_amd_vk |
| 59 | subdir('amd') |
| 60 | endif |
Eric Anholt | 34cefa7 | 2018-07-29 19:22:33 -0700 | [diff] [blame] | 61 | if with_gallium_vc4 or with_gallium_v3d |
Eric Anholt | 1ae8018 | 2017-10-12 13:53:12 -0700 | [diff] [blame] | 62 | subdir('broadcom') |
| 63 | endif |
Dylan Baker | 49fa074 | 2017-11-13 11:14:47 -0800 | [diff] [blame] | 64 | if with_dri_i965 or with_intel_vk |
| 65 | subdir('intel') |
| 66 | endif |
Dylan Baker | 3218056 | 2017-09-20 20:11:32 -0700 | [diff] [blame] | 67 | subdir('mesa') |
Dylan Baker | a47c525 | 2017-09-22 12:55:00 -0700 | [diff] [blame] | 68 | subdir('loader') |
Alexander von Gluck IV | 834d221 | 2018-02-16 16:56:31 -0600 | [diff] [blame] | 69 | if with_platform_haiku |
| 70 | subdir('hgl') |
| 71 | endif |
| 72 | if with_glx != 'disabled' |
| 73 | subdir('glx') |
| 74 | endif |
Dylan Baker | 816bf7d1 | 2017-09-28 15:53:53 -0700 | [diff] [blame] | 75 | if with_gbm |
| 76 | subdir('gbm') |
Dylan Baker | 5fcadae | 2018-01-03 12:33:55 -0800 | [diff] [blame] | 77 | else |
| 78 | inc_gbm = [] |
Dylan Baker | 816bf7d1 | 2017-09-28 15:53:53 -0700 | [diff] [blame] | 79 | endif |
Dylan Baker | 108d257 | 2017-10-18 12:20:43 -0700 | [diff] [blame] | 80 | if with_egl |
| 81 | subdir('egl') |
| 82 | endif |
Dylan Baker | 689fb74 | 2017-11-14 17:03:39 -0800 | [diff] [blame] | 83 | if with_gallium |
| 84 | subdir('gallium') |
Dylan Baker | 34cb4d0 | 2018-02-06 15:46:25 -0800 | [diff] [blame] | 85 | # This has to be here since it requires libgallium, and subdir cannot |
| 86 | # contain .. |
Dylan Baker | d84f003 | 2018-10-05 09:36:05 -0700 | [diff] [blame] | 87 | if with_tests and with_shared_glapi |
Dylan Baker | c73abb4 | 2018-04-18 09:29:35 -0700 | [diff] [blame] | 88 | subdir('mesa/state_tracker/tests') |
| 89 | endif |
Dylan Baker | 689fb74 | 2017-11-14 17:03:39 -0800 | [diff] [blame] | 90 | endif |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 91 | |
| 92 | # This must be after at least mesa, glx, and gallium, since libgl will be |
| 93 | # defined in one of those subdirs depending on the glx provider. |
| 94 | if with_glx != 'disabled' |
Dylan Baker | b9636fe | 2018-02-26 08:43:54 -0800 | [diff] [blame] | 95 | # If using glvnd the pkg-config header should not point to GL_mesa, it should |
| 96 | # point to GL. glvnd is only available on unix like platforms so adding -l |
| 97 | # should be safe here |
| 98 | # TODO: in the glvnd case glvnd itself should really be providing this. |
| 99 | if with_glvnd |
| 100 | _gl = '-L${libdir} -lGL' |
| 101 | else |
| 102 | _gl = libgl |
| 103 | endif |
| 104 | |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 105 | pkg.generate( |
| 106 | name : 'gl', |
| 107 | description : 'Mesa OpenGL Library', |
| 108 | version : meson.project_version(), |
Dylan Baker | 5c46033 | 2018-02-20 10:36:44 -0800 | [diff] [blame] | 109 | libraries : _gl, |
Dylan Baker | 13752af | 2017-11-02 16:51:40 -0700 | [diff] [blame] | 110 | libraries_private : gl_priv_libs, |
| 111 | requires_private : gl_priv_reqs, |
| 112 | variables : ['glx_tls=yes'], |
| 113 | ) |
| 114 | endif |