summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2023-04-21 10:32:37 +0200
committerMarti Maria <marti.maria@littlecms.com>2023-04-21 10:32:37 +0200
commit7984408c8fe800a27175e4a8bd6115663c553ec1 (patch)
treede970af5824c0f849d09227eca4d46cf1e30aeab
parent8769c0e85b0e57de3f55936344766873fa982350 (diff)
downloadlcms2-7984408c8fe800a27175e4a8bd6115663c553ec1.tar.gz
allow build of static libs on windows with MS Visual Studio
Almost: meson uses always ".a" extension which is a pain. I can't solve that.
-rw-r--r--meson.build3
-rw-r--r--meson_options.txt1
-rw-r--r--src/meson.build17
3 files changed, 14 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 086e520..7828943 100644
--- a/meson.build
+++ b/meson.build
@@ -109,7 +109,10 @@ win = import('windows')
subdir('include')
subdir('src')
subdir('testbed')
+
+if get_option('utils')
subdir('utils')
+endif
if get_option('samples')
subdir('utils/samples')
diff --git a/meson_options.txt b/meson_options.txt
index 5adc464..d5121c7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,7 @@
option('jpeg', type: 'feature', value: 'auto', description: 'Use JPEG')
option('tiff', type: 'feature', value: 'auto', description: 'Use LibTiff')
+option('utils', type: 'boolean', value: 'false', description: 'Build the utils')
option('samples', type: 'boolean', value: 'false', description: 'Build the samples')
option('fastfloat', type: 'boolean', value: 'false', description: 'Build and install the fast float plugin, use only if GPL 3.0 is acceptable')
option('threaded', type: 'boolean', value: 'false', description: 'Build and install the multi threaded plugin, use only if GPL 3.0 is acceptable')
diff --git a/src/meson.build b/src/meson.build
index a3204ee..2e1c89f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -28,14 +28,17 @@ lcms2_srcs = files(
)
if host_machine.system() == 'windows'
- lcms2_rc = configure_file(
- input: 'lcms2.rc.in',
- configuration: version_cfg,
- output: 'lcms2.rc',
- )
+ if get_option('default_library') == 'shared'
- lcms2_srcs += win.compile_resources(lcms2_rc)
- cargs += '-DCMS_DLL_BUILD=1'
+ lcms2_rc = configure_file(
+ input: 'lcms2.rc.in',
+ configuration: version_cfg,
+ output: 'lcms2.rc',
+ )
+
+ lcms2_srcs += win.compile_resources(lcms2_rc)
+ cargs += '-DCMS_DLL_BUILD=1'
+ endif
endif
liblcms2_lib = library(