Skip to content

Commit

Permalink
allow build of static libs on windows with MS Visual Studio
Browse files Browse the repository at this point in the history
Almost: meson uses always ".a" extension  which is a pain. I can't solve that.
  • Loading branch information
mm2 committed Apr 21, 2023
1 parent 8769c0e commit 7984408
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -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')
17 changes: 10 additions & 7 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7984408

Please sign in to comment.