CMake: Use libexpat*.(dll|lib) not expat*.(dll|lib) on Windows

This commit is contained in:
Sebastian Pipping 2019-09-21 18:14:37 +02:00
parent 6b19963341
commit de621b53cf
4 changed files with 53 additions and 40 deletions

View file

@ -54,131 +54,131 @@ environment:
# Visual Studio 2010 Win32
- GENERATOR: Visual Studio 10 2010
PLATFORM: Win32
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2010 Win32 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 10 2010
PLATFORM: Win32
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2010 x64
- GENERATOR: Visual Studio 10 2010 Win64
PLATFORM: x64
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2010 x64 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 10 2010 Win64
PLATFORM: x64
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2012 Win32
- GENERATOR: Visual Studio 11 2012
PLATFORM: Win32
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2012 Win32 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 11 2012
PLATFORM: Win32
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2012 x64
- GENERATOR: Visual Studio 11 2012 Win64
PLATFORM: x64
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2012 x64 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 11 2012 Win64
PLATFORM: x64
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2013 Win32
- GENERATOR: Visual Studio 12 2013
PLATFORM: Win32
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2013 Win32 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 12 2013
PLATFORM: Win32
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2013 x64
- GENERATOR: Visual Studio 12 2013 Win64
PLATFORM: x64
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2013 x64 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 12 2013 Win64
PLATFORM: x64
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# Visual Studio 2015 Win32
- GENERATOR: Visual Studio 14 2015
PLATFORM: Win32
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# Visual Studio 2015 Win32 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 14 2015
PLATFORM: Win32
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# Visual Studio 2015 x64
- GENERATOR: Visual Studio 14 2015 Win64
PLATFORM: x64
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# Visual Studio 2015 x64 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 14 2015 Win64
PLATFORM: x64
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# Visual Studio 2017 Win32
- GENERATOR: Visual Studio 15 2017
PLATFORM: Win32
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# Visual Studio 2017 Win32 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 15 2017
PLATFORM: Win32
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# Visual Studio 2017 x64
- GENERATOR: Visual Studio 15 2017 Win64
PLATFORM: x64
EXPAT_DLL: expatd.dll
EXPAT_DLL: libexpatd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# Visual Studio 2017 x64 XML_UNICODE_WCHAR_T
- GENERATOR: Visual Studio 15 2017 Win64
PLATFORM: x64
CMAKE_ARGS: -DEXPAT_CHAR_TYPE=wchar_t
EXPAT_DLL: expatwd.dll
EXPAT_DLL: libexpatwd.dll
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
before_build:

View file

@ -229,7 +229,7 @@ if(WIN32)
set(_POSTFIX_DEBUG "")
endif()
set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. expat<postfix=[w][d][MD|MT]>.lib")
set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat<postfix=[w][d][MD|MT]>.lib")
endforeach()
endif(WIN32)
@ -257,9 +257,16 @@ else(EXPAT_SHARED_LIBS)
endif(WIN32)
endif(EXPAT_SHARED_LIBS)
add_library(expat ${_SHARED} ${expat_SRCS})
# Avoid colliding with Expat.dll of Perl's XML::Parser::Expat
if(WIN32 AND NOT MINGW)
set(_EXPAT_TARGET libexpat)
else()
set(_EXPAT_TARGET expat)
endif()
add_library(${_EXPAT_TARGET} ${_SHARED} ${expat_SRCS})
if(EXPAT_WITH_LIBBSD)
target_link_libraries(expat ${LIB_BSD})
target_link_libraries(${_EXPAT_TARGET} ${LIB_BSD})
endif()
set(LIBCURRENT 7) # sync
@ -268,12 +275,12 @@ set(LIBAGE 6) # configure.ac!
math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
if(NOT WIN32)
set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
set_property(TARGET ${_EXPAT_TARGET} PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
set_property(TARGET ${_EXPAT_TARGET} PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
set_property(TARGET ${_EXPAT_TARGET} PROPERTY NO_SONAME ${NO_SONAME})
endif(NOT WIN32)
expat_install(TARGETS expat EXPORT expat
expat_install(TARGETS ${_EXPAT_TARGET} EXPORT expat
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
@ -305,7 +312,7 @@ if(EXPAT_BUILD_TOOLS)
add_executable(xmlwf ${xmlwf_SRCS})
set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
target_link_libraries(xmlwf expat)
target_link_libraries(xmlwf ${_EXPAT_TARGET})
expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
if(MINGW AND _EXPAT_UNICODE_WCHAR_T)
@ -315,7 +322,7 @@ if(EXPAT_BUILD_TOOLS)
if(EXPAT_BUILD_DOCS)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1")
add_custom_command(TARGET ${_EXPAT_TARGET} PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1")
expat_install(FILES "${PROJECT_BINARY_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
endif()
@ -326,11 +333,11 @@ endif()
if(EXPAT_BUILD_EXAMPLES)
add_executable(elements examples/elements.c)
set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
target_link_libraries(elements expat)
target_link_libraries(elements ${_EXPAT_TARGET})
add_executable(outline examples/outline.c)
set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
target_link_libraries(outline expat)
target_link_libraries(outline ${_EXPAT_TARGET})
endif(EXPAT_BUILD_EXAMPLES)
#
@ -365,12 +372,12 @@ if(EXPAT_BUILD_TESTS)
add_executable(runtests tests/runtests.c ${test_SRCS})
set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
target_link_libraries(runtests expat)
target_link_libraries(runtests ${_EXPAT_TARGET})
expat_add_test(runtests $<TARGET_FILE:runtests>)
add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS})
set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
target_link_libraries(runtestspp expat)
target_link_libraries(runtestspp ${_EXPAT_TARGET})
expat_add_test(runtestspp $<TARGET_FILE:runtestspp>)
endif(EXPAT_BUILD_TESTS)
@ -491,7 +498,7 @@ write_basic_package_version_file(
)
export(
TARGETS
expat
${_EXPAT_TARGET}
FILE
cmake/expat-targets.cmake # not going to be installed
)

View file

@ -5,6 +5,12 @@ NOTE: We are looking for help with a few things:
Release x.x.x xxx xxxxxxxxx xx xxxx
Other changes:
examples: Drop executable bits from elements.c
#349 Windows: Change the name of the Windows DLLs from expat*.dll
to libexpat*.dll once more (regression from 2.2.8, first
fixed in 1.95.3, issue #61 on SourceForge today,
was issue #432456 back then); needs a fix due
case-insensitive file systems on Windows and the fact that
Perl's XML::Parser::Expat compiles into Expat.dll.
Release 2.2.8 Fri Septemper 13 2019
Security fixes:

View file

@ -47,8 +47,8 @@ CD build_shared_char || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
COPY build_shared_char\%CONFIGURATION%\expat.dll %BINDIR%\ || EXIT /b 1
COPY build_shared_char\%CONFIGURATION%\expat.lib %BINDIR%\ || EXIT /b 1
COPY build_shared_char\%CONFIGURATION%\libexpat.dll %BINDIR%\ || EXIT /b 1
COPY build_shared_char\%CONFIGURATION%\libexpat.lib %BINDIR%\ || EXIT /b 1
MD build_static_char || EXIT /b 1
@ -57,7 +57,7 @@ CD build_static_char || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
COPY build_static_char\%CONFIGURATION%\expatMT.lib %BINDIR%\ || EXIT /b 1
COPY build_static_char\%CONFIGURATION%\libexpatMT.lib %BINDIR%\ || EXIT /b 1
COPY build_static_char\xmlwf\%CONFIGURATION%\xmlwf.exe %BINDIR%\ || EXIT /b 1
@ -67,8 +67,8 @@ CD build_shared_wchar_t || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
COPY build_shared_wchar_t\%CONFIGURATION%\expatw.dll %BINDIR%\ || EXIT /b 1
COPY build_shared_wchar_t\%CONFIGURATION%\expatw.lib %BINDIR%\ || EXIT /b 1
COPY build_shared_wchar_t\%CONFIGURATION%\libexpatw.dll %BINDIR%\ || EXIT /b 1
COPY build_shared_wchar_t\%CONFIGURATION%\libexpatw.lib %BINDIR%\ || EXIT /b 1
MD build_static_wchar_t || EXIT /b 1
@ -77,7 +77,7 @@ CD build_static_wchar_t || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
COPY build_static_wchar_t\%CONFIGURATION%\expatwMT.lib %BINDIR%\ || EXIT /b 1
COPY build_static_wchar_t\%CONFIGURATION%\libexpatwMT.lib %BINDIR%\ || EXIT /b 1
DIR %BINDIR% || EXIT /b 1