Skip to content

Commit dc5b103

Browse files
authored
fix compilation under mingw32 (#222)
mingw32 does not enable SSE2 by default.
1 parent 13cb56a commit dc5b103

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ if get_option('default_library') == 'static'
1212
static_subproject = meson.is_subproject()
1313
endif
1414

15+
cc = meson.get_compiler('c')
16+
1517
if get_option('enable_opt') == false
1618
add_project_arguments('-DSPNG_DISABLE_OPT', language : 'c')
19+
elif cc.get_argument_syntax() == 'gcc' and host_machine.system() == 'x86'
20+
add_project_arguments('-msse2', language : 'c')
1721
endif
1822

19-
cc = meson.get_compiler('c')
20-
2123
# Check for GNU target_clones attribute
2224
if cc.compiles(files('tests/target_clones.c'), args : '-Werror', name : 'have target_clones')
2325
add_project_arguments('-DSPNG_ENABLE_TARGET_CLONES', language : 'c')

0 commit comments

Comments
 (0)