blob: 887d78111895b206d2b03a37d8127bb4370e7107 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import("//garnet/lib/magma/gnbuild/magma.gni")
source_set("api_xml") {
sources = [
"AMD_draw_buffers_blend.xml",
"AMD_performance_monitor.xml",
"APPLE_object_purgeable.xml",
"APPLE_vertex_array_object.xml",
"ARB_ES2_compatibility.xml",
"ARB_ES3_compatibility.xml",
"ARB_base_instance.xml",
"ARB_blend_func_extended.xml",
"ARB_clear_buffer_object.xml",
"ARB_clear_texture.xml",
"ARB_clip_control.xml",
"ARB_color_buffer_float.xml",
"ARB_compressed_texture_pixel_storage.xml",
"ARB_compute_shader.xml",
"ARB_copy_buffer.xml",
"ARB_copy_image.xml",
"ARB_debug_output.xml",
"ARB_depth_buffer_float.xml",
"ARB_depth_clamp.xml",
"ARB_direct_state_access.xml",
"ARB_draw_buffers.xml",
"ARB_draw_buffers_blend.xml",
"ARB_draw_elements_base_vertex.xml",
"ARB_draw_indirect.xml",
"ARB_draw_instanced.xml",
"ARB_framebuffer_no_attachments.xml",
"ARB_framebuffer_object.xml",
"ARB_get_program_binary.xml",
"ARB_get_texture_sub_image.xml",
"ARB_gpu_shader5.xml",
"ARB_gpu_shader_fp64.xml",
"ARB_indirect_parameters.xml",
"ARB_instanced_arrays.xml",
"ARB_internalformat_query.xml",
"ARB_invalidate_subdata.xml",
"ARB_map_buffer_range.xml",
"ARB_multi_bind.xml",
"ARB_pipeline_statistics_query.xml",
"ARB_program_interface_query.xml",
"ARB_robustness.xml",
"ARB_sample_shading.xml",
"ARB_sampler_objects.xml",
"ARB_seamless_cube_map.xml",
"ARB_separate_shader_objects.xml",
"ARB_shader_atomic_counters.xml",
"ARB_shader_image_load_store.xml",
"ARB_shader_storage_buffer_object.xml",
"ARB_shader_subroutine.xml",
"ARB_sync.xml",
"ARB_tessellation_shader.xml",
"ARB_texture_barrier.xml",
"ARB_texture_buffer_object.xml",
"ARB_texture_buffer_range.xml",
"ARB_texture_compression_rgtc.xml",
"ARB_texture_cube_map_array.xml",
"ARB_texture_float.xml",
"ARB_texture_gather.xml",
"ARB_texture_multisample.xml",
"ARB_texture_rg.xml",
"ARB_texture_rgb10_a2ui.xml",
"ARB_texture_storage.xml",
"ARB_texture_storage_multisample.xml",
"ARB_texture_view.xml",
"ARB_uniform_buffer_object.xml",
"ARB_vertex_array_object.xml",
"ARB_vertex_attrib_64bit.xml",
"ARB_vertex_attrib_binding.xml",
"ARB_vertex_type_2_10_10_10_rev.xml",
"ARB_viewport_array.xml",
"EXT_draw_buffers2.xml",
"EXT_framebuffer_object.xml",
"EXT_gpu_shader4.xml",
"EXT_packed_depth_stencil.xml",
"EXT_provoking_vertex.xml",
"EXT_separate_shader_objects.xml",
"EXT_texture_array.xml",
"EXT_texture_integer.xml",
"EXT_transform_feedback.xml",
"GL3x.xml",
"GL4x.xml",
"GREMEDY_string_marker.xml",
"INTEL_performance_query.xml",
"KHR_context_flush_control.xml",
"KHR_debug.xml",
"KHR_texture_compression_astc.xml",
"NV_conditional_render.xml",
"NV_primitive_restart.xml",
"NV_texture_barrier.xml",
"NV_vdpau_interop.xml",
"OES_EGL_image.xml",
"OES_fixed_point.xml",
"OES_single_precision.xml",
"es_EXT.xml",
"glX_API.xml",
"gl_API.xml",
"gl_and_es_API.xml",
"gl_and_glX_API.xml",
]
}
action("glapi_mapi_tmp") {
output_name = "glapi/glapi_mapi_tmp.h"
script_name = "../../mapi_abi.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"--printer",
"es2api",
"--mode",
"lib",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("gl_procs") {
output_name = "glapi/glprocs.h"
script_name = "gl_procs.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-c",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("gl_apitemp") {
output_name = "glapi/glapitemp.h"
script_name = "gl_apitemp.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("gl_table") {
output_name = "glapi/glapitable.h"
script_name = "gl_table.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("gl_gentable") {
output_name = "glapi/glapi_gentable.c"
script_name = "gl_gentable.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("glapi_x86-64") {
output_name = "glapi/glapi_x86-64.S"
script_name = "gl_x86-64_asm.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("enums") {
output_name = "main/enums.c"
script_name = "gl_enums.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("api_exec") {
output_name = "main/api_exec.c"
script_name = "gl_genexec.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
"apiexec.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
action("dispatch") {
output_name = "main/dispatch.h"
script_name = "gl_table.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
"-m",
"remap_table",
]
}
action("remap_helper") {
output_name = "main/remap_helper.h"
script_name = "remap_helper.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
deps = [
":api_xml",
]
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
"gl_XML.py",
"license.py",
"static_data.py",
"typeexpr.py",
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
"-f",
rebase_path(".") + "/gl_and_es_API.xml",
]
}
config("gen_public_config") {
include_dirs = [
"$mesa_build_root/src",
"$mesa_build_root/src/mapi",
"$mesa_build_root/src/mapi/glapi",
"$mesa_build_root/src/mesa",
rebase_path(target_gen_dir),
rebase_path("$target_gen_dir/main"),
]
defines = [
"MAPI_MODE_BRIDGE",
"MAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"",
]
}
source_set("glapi_gen") {
cflags = [ "-std=c11" ]
public_configs = [
":gen_public_config",
"$mesa_build_root/src:common_config",
]
include_dirs = [ "$mesa_build_root/src/mapi" ]
sources = [
"$target_gen_dir/glapi/glapi_gentable.c",
"$target_gen_dir/glapi/glapi_mapi_tmp.h",
"$target_gen_dir/glapi/glapitable.h",
"$target_gen_dir/glapi/glapitemp.h",
"$target_gen_dir/glapi/glprocs.h",
]
deps = [
":gl_apitemp",
":gl_gentable",
":gl_procs",
":gl_table",
":glapi_mapi_tmp",
":glapi_x86-64",
"$mesa_build_root/include:GL",
]
}
source_set("main_gen") {
configs += [ "$mesa_build_root/src:common_config" ]
public_configs = [ ":gen_public_config" ]
sources = [
"$target_gen_dir/main/api_exec.c",
"$target_gen_dir/main/dispatch.h",
"$target_gen_dir/main/enums.c",
"$target_gen_dir/main/remap_helper.h",
]
deps = [
":api_exec",
":dispatch",
":enums",
":remap_helper",
"$mesa_build_root/include:GL",
"$mesa_build_root/include:c_compat",
"$mesa_build_root/src/util:headers",
]
}
source_set("gen") {
public_deps = [
":glapi_gen",
":main_gen",
]
}