Skip to content
Snippets Groups Projects
Commit edee18ea authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

adopt build sytem to windows

parent b62f5556
Branches
Tags
1 merge request!11decompression/compression for non-imagette data
...@@ -17,5 +17,6 @@ cmplib_sources = files([ ...@@ -17,5 +17,6 @@ cmplib_sources = files([
cmp_lib = static_library('cmp_lib', cmp_lib = static_library('cmp_lib',
sources : cmplib_sources, sources : cmplib_sources,
include_directories : incdir, include_directories : incdir,
c_args : ['-DDEBUGLEVEL=1'] c_args : ['-DDEBUGLEVEL=1'],
install : 'true' # linking under windows mingw only works if this is set
) )
...@@ -4,11 +4,12 @@ project('cmp_tool', 'c', ...@@ -4,11 +4,12 @@ project('cmp_tool', 'c',
default_options : ['warning_level=3', 'c_std=gnu99'] default_options : ['warning_level=3', 'c_std=gnu99']
) )
if host_machine.system() == 'windows' and cc.get_id() == 'gcc' if host_machine.system() == 'windows' and meson.get_compiler('c').get_id() == 'gcc'
# by default, MinGW on win32 behaves as if it ignores __attribute__((packed)), # by default, MinGW on win32 behaves as if it ignores __attribute__((packed)),
# you need to add -mno-ms-bitfields to make it work as expected. # you need to add -mno-ms-bitfields to make it work as expected.
# See: https://wintermade.it/blog/posts/__attribute__packed-on-windows-is-ignored-with-mingw.html # See: https://wintermade.it/blog/posts/__attribute__packed-on-windows-is-ignored-with-mingw.html
add_project_arguments('-mno-ms-bitfields', language : 'c') add_project_arguments('-mno-ms-bitfields', language : 'c')
add_global_link_arguments('-static', language: 'c')
endif endif
subdir('include') subdir('include')
......
...@@ -1136,6 +1136,11 @@ def test_model_fiel_erros(): ...@@ -1136,6 +1136,11 @@ def test_model_fiel_erros():
"longlonglonglonglonglonglonglonglonglonglonglonglong" "longlonglonglonglonglonglonglonglonglonglonglonglong"
"longlonglonglonglonglonglonglonglonglonglonglonglong" "longlonglonglonglonglonglonglonglonglonglonglonglong"
"longlonglonglonglonglonglonglonglonglong") "longlonglonglonglonglonglonglonglonglong")
if sys.platform == 'win32' or sys.platform == 'cygwin':
output_prefix = ("longlonglonglonglonglonglonglonglonglonglonglonglong"
"longlonglonglonglonglonglonglonglonglonglonglonglong"
"longlonglonglonglonglonglonglonglonglonglonglonglong"
"longlonglonglonglonglonglonglonglonglonglong")
returncode, stdout, stderr = call_cmp_tool( returncode, stdout, stderr = call_cmp_tool(
" -c "+cfg_file_name+" -d "+data_file_name + " -m "+model_file_name+" -o "+output_prefix) " -c "+cfg_file_name+" -d "+data_file_name + " -m "+model_file_name+" -o "+output_prefix)
assert(returncode == EXIT_FAILURE) assert(returncode == EXIT_FAILURE)
...@@ -1147,8 +1152,10 @@ def test_model_fiel_erros(): ...@@ -1147,8 +1152,10 @@ def test_model_fiel_erros():
"Compress data ... DONE\n" + "Compress data ... DONE\n" +
"Write compressed data to file %s.cmp ... DONE\n" %(output_prefix) + "Write compressed data to file %s.cmp ... DONE\n" %(output_prefix) +
"Write updated model to file %s_upmodel.dat ... FAILED\n" %(output_prefix)) "Write updated model to file %s_upmodel.dat ... FAILED\n" %(output_prefix))
if sys.platform == 'win32' or sys.platform == 'cygwin':
assert(stderr == "cmp_tool: %s_upmodel.dat: No such file or directory\n" % (output_prefix))
else:
assert(stderr == "cmp_tool: %s_upmodel.dat: File name too long\n" % (output_prefix)) assert(stderr == "cmp_tool: %s_upmodel.dat: File name too long\n" % (output_prefix))
#
finally: finally:
del_file(data_file_name) del_file(data_file_name)
......
...@@ -32,7 +32,7 @@ endif ...@@ -32,7 +32,7 @@ endif
subdir('cmp_tool') subdir('cmp_tool')
cunit_dep = dependency('cunit') cunit_dep = dependency('cunit', required : false)
if cunit_dep.found() if cunit_dep.found()
subdir('cmp_icu') subdir('cmp_icu')
endif endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment