summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanc999@yahoo.com.tw>2018-06-08 14:38:30 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2018-06-08 17:12:37 +0800
commit268d3b890008f6b0c1a84c1686ad82e8efc84d5e (patch)
tree6893785526891d82934275c67f0ef5fce1e25674
parent84da85139a88b7280f6217f6154f9a95aba916c5 (diff)
downloadgdk-pixbuf-268d3b890008f6b0c1a84c1686ad82e8efc84d5e.tar.gz
build: Add post install script for MSVC builds
Visual Studio builds do not assume the presence of a shell script interpreter but would normally use cmd.exe, which would make the post install shell script useless in such situations. Fix this by adding a Windows .bat port of the post install script, to be used on Visual Studio builds, which may be usable on MinGW builds if MinGW builds can be done directly in cmd.exe.
-rw-r--r--build-aux/post-install.bat23
-rw-r--r--meson.build16
2 files changed, 35 insertions, 4 deletions
diff --git a/build-aux/post-install.bat b/build-aux/post-install.bat
new file mode 100644
index 000000000..60981ffb2
--- /dev/null
+++ b/build-aux/post-install.bat
@@ -0,0 +1,23 @@
+@echo off
+
+set libdir=%1
+set binary_version=%2
+
+set libdir_windows=%libdir:/=\%
+
+if not "%DESTDIR%" == "" goto warn_msg
+if not exist %libdir_windows%\gdk-pixbuf-2.0\%binary_version%\ mkdir %libdir_windows%\gdk-pixbuf-2.0\%binary_version%
+gdk-pixbuf-query-loaders > %libdir_windows%\gdk-pixbuf-2.0\%binary_version%\loaders.cache
+
+goto end
+
+:warn_msg
+echo ***
+echo *** Warning: loaders.cache not built
+echo ***
+echo *** You should generate this file manually on the host system
+echo *** using:
+echo *** gdk-pixbuf-query-loaders ^> %libdir_windows%\gdk-pixbuf-2.0\%binary_version%\loaders.cache
+echo ***
+
+:end \ No newline at end of file
diff --git a/meson.build b/meson.build
index 3c656d430..fafaf2da3 100644
--- a/meson.build
+++ b/meson.build
@@ -407,10 +407,18 @@ subdir('thumbnailer')
subdir('docs')
if not meson.is_cross_build()
- meson.add_install_script('build-aux/post-install.sh',
- gdk_pixbuf_libdir,
- gdk_pixbuf_binary_version,
- )
+ # On Visual Studio, we don't normally have a shell interpreter, so use a .bat
+ if cc.get_id() == 'msvc'
+ meson.add_install_script('build-aux/post-install.bat',
+ gdk_pixbuf_libdir,
+ gdk_pixbuf_binary_version,
+ )
+ else
+ meson.add_install_script('build-aux/post-install.sh',
+ gdk_pixbuf_libdir,
+ gdk_pixbuf_binary_version,
+ )
+ endif
endif
summary = [