summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-04-18 13:22:35 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-05-17 11:06:01 -0700
commit8e4ab6d87365ec1982ff4ac810a34055ef940c62 (patch)
tree12d3ef9addca6e413ddfad884eca8983ca3a2d2d
parent4649e9ad996e4b2dc4e3e70ed3df3f2c59b88608 (diff)
meson: Add windows defines to glapi
These are needed to control the export or symbols due to differences between the way windows and *nix handle symbol exports.
-rw-r--r--src/mapi/es1api/meson.build10
-rw-r--r--src/mapi/es2api/meson.build10
-rw-r--r--src/mapi/glapi/meson.build13
-rw-r--r--src/mapi/shared-glapi/meson.build9
4 files changed, 38 insertions, 4 deletions
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 657dc2d9ef..dcf0aa5749 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -27,11 +27,19 @@ es1_glapi_mapi_tmp_h = custom_target(
capture : true,
)
+_es1_c_args = []
+if with_platform_windows
+ _es1_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
libglesv1_cm = shared_library(
'GLESv1_CM',
['../entry.c', es1_glapi_mapi_tmp_h],
c_args : [
- c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+ c_msvc_compat_args,
+ c_vis_args,
+ _es1_c_args,
+ '-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
],
link_args : [ld_args_gc_sections],
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index da5198ed6e..abd633fbb6 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -27,11 +27,19 @@ es2_glapi_mapi_tmp_h = custom_target(
capture : true,
)
+_es2_c_args = []
+if with_platform_windows
+ _es2_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
libgles2 = shared_library(
'GLESv2',
['../entry.c', es2_glapi_mapi_tmp_h],
c_args : [
- c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+ c_msvc_compat_args,
+ c_vis_args,
+ _es2_c_args,
+ '-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
],
link_args : [ld_args_gc_sections],
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index e241d9ed38..854a04e654 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -25,7 +25,7 @@ inc_glapi = include_directories('.')
static_glapi_files = []
static_glapi_args = []
-if ['apple', 'windows'].contains(with_dri_platform)
+if with_dri and ['apple', 'windows'].contains(with_dri_platform)
static_glapi_files += [glapi_gentable_c, glapitable_h]
endif
@@ -45,8 +45,19 @@ if with_shared_glapi
'-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
]
+ if with_platform_windows
+ static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32']
+ endif
else
static_glapi_args += '-DMAPI_MODE_UTIL'
+ if with_platform_windows
+ static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32', '-DKHRONOS_DLL_EXPORTS']
+ if with_gles1 or with_gles2
+ static_glapi_args += '-D_GLAPI_DLL_EXPORTS'
+ else
+ static_glapi_args += '-D_GLAPI_NO_EXPORTS'
+ endif
+ endif
static_glapi_files += files(
'glapi_dispatch.c',
'glapi_entrypoint.c',
diff --git a/src/mapi/shared-glapi/meson.build b/src/mapi/shared-glapi/meson.build
index c7d136ced2..e1f68691b4 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -36,11 +36,18 @@ shared_glapi_mapi_tmp_h = custom_target(
capture : true,
)
+_glapi_c_args = []
+if with_platform_windows
+ _glapi_c_args += ['-D_GLAPI_DLL_EXPORTS']
+endif
+
libglapi = shared_library(
'glapi',
[files_mapi_glapi, files_mapi_util, shared_glapi_mapi_tmp_h],
c_args : [
- c_msvc_compat_args, '-DMAPI_MODE_GLAPI',
+ _glapi_c_args,
+ c_msvc_compat_args,
+ '-DMAPI_MODE_GLAPI',
'-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
],
link_args : [ld_args_gc_sections],