From 5aa6475ca5d3c7eda7a08b1b8eaec404d3800b2b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 9 Oct 2019 23:14:21 +0200 Subject: [PATCH] CMake: Create libexpatw.{dll,so} and expatw.pc with -DEXPAT_CHAR_TYPE=(ushort|wchar_t) --- expat/CMakeLists.txt | 12 ++++++++---- expat/coverage.sh | 2 +- expat/expat.pc.in | 4 ++-- expat/qa.sh | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index a05eff2b..4873e41b 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -261,9 +261,13 @@ endif(EXPAT_SHARED_LIBS) # Avoid colliding with Expat.dll of Perl's XML::Parser::Expat if(WIN32 AND NOT MINGW) - set(_EXPAT_TARGET libexpat) + set(_EXPAT_TARGET libexpat) # CMAKE_*_POSTFIX applies, see above else() - set(_EXPAT_TARGET expat) + if(_EXPAT_UNICODE) + set(_EXPAT_TARGET expatw) + else() + set(_EXPAT_TARGET expat) + endif() endif() add_library(${_EXPAT_TARGET} ${_SHARED} ${expat_SRCS}) @@ -297,8 +301,8 @@ if(NOT MSVC) set(exec_prefix "\${prefix}") set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") - configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY) - expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${_EXPAT_TARGET}.pc @ONLY) + expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_EXPAT_TARGET}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() # diff --git a/expat/coverage.sh b/expat/coverage.sh index 6ab44d81..7990a7fa 100755 --- a/expat/coverage.sh +++ b/expat/coverage.sh @@ -99,7 +99,7 @@ _copy_missing_mingw_libaries() { done fi - for dll in libexpat.dll; do + for dll in libexpat{,w}.dll; do ( set -x ln -s "${abs_build_dir}"/${dll} "${target}"/${dll} diff --git a/expat/expat.pc.in b/expat/expat.pc.in index 5207e3e1..d4b62433 100644 --- a/expat/expat.pc.in +++ b/expat/expat.pc.in @@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: expat +Name: @_EXPAT_TARGET@ Version: @PACKAGE_VERSION@ Description: expat XML parser URL: http://www.libexpat.org -Libs: -L${libdir} -lexpat +Libs: -L${libdir} -l@_EXPAT_TARGET@ Cflags: -I${includedir} diff --git a/expat/qa.sh b/expat/qa.sh index 9525d51d..ca4fe07e 100755 --- a/expat/qa.sh +++ b/expat/qa.sh @@ -126,7 +126,7 @@ run_tests() { /usr/i686-w64-mingw32/lib/libwinpthread-1.dll \ /usr/lib/gcc/i686-w64-mingw32/*/libgcc_s_sjlj-1.dll \ /usr/lib/gcc/i686-w64-mingw32/*/libstdc++-6.dll \ - "$PWD"/libexpat.dll \ + "$PWD"/libexpat{,w}.dll \ ${i}/ done fi -- 2.40.0