summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2020-05-04 18:49:44 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-05-06 00:18:35 +0800
commit16e6d3ce59638846fc09caec7b9014b9230fbb30 (patch)
tree237ce386a1421d433a454b6aecb8cc803a865280
parentdc818580f96ada898e21451624f1281566fa4a19 (diff)
meson: Don't use gendef on Visual Studio
Instead, we use the newly-added CAIROMM_API which is defined to be __declspec(dllexport) to export the symbols directly. This will also allow some cleanup in the Meson build files, as we do not need to differentiate how the cairomm library is built on different compilers.
-rw-r--r--MSVC_NMake/gendef/meson.build9
-rw-r--r--Makefile.am1
-rw-r--r--cairomm/meson.build52
-rw-r--r--meson.build3
4 files changed, 10 insertions, 55 deletions
diff --git a/MSVC_NMake/gendef/meson.build b/MSVC_NMake/gendef/meson.build
deleted file mode 100644
index 3dc9cc2..0000000
--- a/MSVC_NMake/gendef/meson.build
+++ /dev/null
@@ -1,9 +0,0 @@
-# MSVC_NMake/gendef
-
-# Input: is_msvc
-# Output: gendef
-
-# Used to generate the .def file required to obtain the import .lib file
-if is_msvc
- gendef = executable('gendef', 'gendef.cc', install: false)
-endif
diff --git a/Makefile.am b/Makefile.am
index 0f50ed5..1f67414 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,6 @@ EXTRA_DIST = \
meson_options.txt \
cairommconfig.h.meson \
MSVC_NMake/cairomm/meson.build \
- MSVC_NMake/gendef/meson.build \
cairomm/meson.build \
data/meson.build \
docs/reference/meson.build \
diff --git a/cairomm/meson.build b/cairomm/meson.build
index 298c930..afc724f 100644
--- a/cairomm/meson.build
+++ b/cairomm/meson.build
@@ -1,7 +1,7 @@
# cairomm
# Input: cairomm_build_dep, cairomm_pcname, cairomm_libversion, cairomm_rc,
-# is_msvc, gendef
+# is_msvc
# Output: source_h_files, cairomm_dep
# There are no built source files in cairomm.
@@ -79,48 +79,14 @@ endif
extra_include_dirs = ['..']
-if not is_msvc
- cairomm_library = library(cairomm_pcname,
- cairomm_cc, extra_cairomm_objects,
- version: cairomm_libversion,
- include_directories: extra_include_dirs,
- cpp_args: cairomm_cpp_args,
- dependencies: cairomm_build_dep,
- install: true,
- )
-else # is_msvc
-
- # Run gendef.exe to get the .def file needed for obtaining
- # the .lib file for the cairomm DLL.
- cairomm_int_lib = static_library('cairomm-int',
- cairomm_cc,
- include_directories: extra_include_dirs,
- cpp_args: cairomm_cpp_args,
- dependencies: cairomm_build_dep,
- install: false,
- )
-
- cairomm_def = custom_target('cairomm.def',
- output: 'cairomm.def',
- depends: cairomm_int_lib,
- command: [ gendef,
- '@OUTPUT@',
- '@0@-@1@.dll'.format(cairomm_pcname, cairomm_libversion.split('.')[0]),
- cairomm_int_lib.full_path(),
- ],
- install: false,
- )
- cairomm_extra_link_args = ['/def:@0@'.format(cairomm_def.full_path())]
-
- cairomm_library = library(cairomm_pcname, extra_cairomm_objects,
- objects: cairomm_int_lib.extract_all_objects(),
- version: cairomm_libversion,
- dependencies: cairomm_build_dep,
- link_depends: cairomm_def,
- link_args: cairomm_extra_link_args,
- install: true,
- )
-endif
+cairomm_library = library(cairomm_pcname,
+ cairomm_cc, extra_cairomm_objects,
+ version: cairomm_libversion,
+ include_directories: extra_include_dirs,
+ cpp_args: cairomm_cpp_args,
+ dependencies: cairomm_build_dep,
+ install: true,
+)
# This is useful in the main project when cairomm is used as a subproject.
# It's also used when building example programs and test programs.
diff --git a/meson.build b/meson.build
index b9e09ad..837a1ae 100644
--- a/meson.build
+++ b/meson.build
@@ -203,7 +203,7 @@ add_project_arguments(warning_flags, language: 'cpp')
# MSVC: Ignore warnings that aren't really harmful, but make those
# that should not be overlooked stand out.
if is_msvc
- foreach wd : ['/FImsvc_recommended_pragmas.h', '/wd4267', '/wd4530', '/utf-8']
+ foreach wd : ['/FImsvc_recommended_pragmas.h', '/wd4251', '/wd4267', '/wd4275', '/wd4530', '/utf-8']
disabled_warning = cpp_compiler.get_supported_arguments(wd)
add_project_arguments(disabled_warning, language: 'cpp')
endforeach
@@ -230,7 +230,6 @@ cairommconfig_h = configure_file(
install_dir: install_includeconfigdir,
)
-subdir('MSVC_NMake/gendef')
subdir('MSVC_NMake/cairomm')
subdir('data')
subdir('cairomm')