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-05 16:56:19 +0800
commitb932b8afb69bc62f8639051c605fbeb2b78f1022 (patch)
tree0e6ccd21a261e3cde70783ea9738ce1403abefe6
parent0ce9199ed9c588c19a907ebcd4ce2733d04c2ad9 (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--cairomm/meson.build50
-rw-r--r--meson.build3
3 files changed, 9 insertions, 53 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/cairomm/meson.build b/cairomm/meson.build
index 298c930..42303c7 100644
--- a/cairomm/meson.build
+++ b/cairomm/meson.build
@@ -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 28137a7..f6eacd8 100644
--- a/meson.build
+++ b/meson.build
@@ -210,7 +210,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
@@ -237,7 +237,6 @@ cairommconfig_h = configure_file(
install_dir: install_includeconfigdir,
)
-subdir('MSVC_NMake/gendef')
subdir('MSVC_NMake/cairomm')
subdir('data')
subdir('cairomm')