Do not link with iconv when cross-compilating to windows.

Ideally we should check if iconv is present to know if ctpp2 has been
build with iconv.
This may be a bit too complex for our present case. As we know our
cross-compilation environment. It is better to remove the use of iconv
everywhere for now.
This commit is contained in:
Matthieu Gautier 2017-02-07 12:24:13 +01:00
parent 8e8724b6be
commit 7b76d432a7
1 changed files with 10 additions and 10 deletions

View File

@ -21,11 +21,11 @@ if ctpp2_prefix_install == ''
ctpp2_lib = find_library('ctpp2') ctpp2_lib = find_library('ctpp2')
endif endif
link_args = ['-lctpp2'] link_args = ['-lctpp2']
if meson.is_cross_build() # if meson.is_cross_build()
if host_machine.system() == 'windows' # if host_machine.system() == 'windows'
link_args += ['-liconv'] # link_args += ['-liconv']
endif # endif
endif # endif
ctpp2_dep = declare_dependency(link_args:link_args) ctpp2_dep = declare_dependency(link_args:link_args)
else else
if not find_library_in_compiler if not find_library_in_compiler
@ -40,11 +40,11 @@ else
ctpp2_lib_path = ctpp2_prefix_install+'/lib' ctpp2_lib_path = ctpp2_prefix_install+'/lib'
ctpp2_lib = compiler.find_library('ctpp2', dirs:ctpp2_lib_path) ctpp2_lib = compiler.find_library('ctpp2', dirs:ctpp2_lib_path)
link_args = ['-L'+ctpp2_lib_path, '-lctpp2'] link_args = ['-L'+ctpp2_lib_path, '-lctpp2']
if meson.is_cross_build() # if meson.is_cross_build()
if host_machine.system() == 'windows' # if host_machine.system() == 'windows'
link_args += ['-liconv'] # link_args += ['-liconv']
endif # endif
endif # endif
ctpp2_dep = declare_dependency(include_directories:ctpp2_include_path, link_args:link_args) ctpp2_dep = declare_dependency(include_directories:ctpp2_include_path, link_args:link_args)
endif endif