3
0
Fork 0

Do not try to link with ctpp2-st.

ctpp2-st is not a standard name, all other projects use the same base name
for dynamic and static libs.

Debian already patch the lib name in the ctpp2 package.
As we also patch it in kiwix-build, we can ignore ctpp2-st and always
try to link on ctpp2.

This is even necessary as ctpp2-st is not existing at all is those
usecases, so we cannot try to link with ctpp2-st when compiling statically.

We could fix, the ctpp2 lib search to search ctpp2 and ctpp2-st when
compiling statically but it seems to be a lot of work for nothing
as ctpp2-st is not used at all in our usecases.
small_fixes
Matthieu Gautier 9 years ago
parent e8dc6b0f45
commit db7e1e5c8f

@ -12,23 +12,17 @@ z_dep = dependency('zlib')
# But there is no pkg-config file for ctpp2. Once one exists, no need to
# declare the dependency here
ctpp2_prefix_install = get_option('ctpp2-install-prefix')
if get_option('default_library') == 'static'
libname = 'ctpp2-st'
else
libname = 'ctpp2'
endif
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
if ctpp2_prefix_install == ''
if not compiler.has_header('ctpp2/CTPP2Logger.hpp')
error('ctpp2/CTPP2Logger.hppnot found')
endif
if find_library_in_compiler
ctpp2_lib = compiler.find_library(libname)
ctpp2_lib = compiler.find_library('ctpp2')
else
ctpp2_lib = find_library(libname)
ctpp2_lib = find_library('ctpp2')
endif
link_args = ['-l'+libname]
link_args = ['-lctpp2']
if meson.is_cross_build()
if host_machine.system() == 'windows'
link_args += ['-liconv']
@ -46,8 +40,8 @@ else
endif
ctpp2_include_path = include_directories(ctpp2_include_path, is_system:true)
ctpp2_lib_path = ctpp2_prefix_install+'/lib'
ctpp2_lib = compiler.find_library(libname, dirs:ctpp2_lib_path)
link_args = ['-L'+ctpp2_lib_path, '-l'+libname]
ctpp2_lib = compiler.find_library('ctpp2', dirs:ctpp2_lib_path)
link_args = ['-L'+ctpp2_lib_path, '-lctpp2']
if meson.is_cross_build()
if host_machine.system() == 'windows'
link_args += ['-liconv']

Loading…
Cancel
Save