mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
fix MinGW build on Windows
This commit is contained in:
parent
6cc83c5072
commit
11f9c71d75
@ -198,7 +198,8 @@ if(LYX_USE_QT MATCHES "QT5")
|
||||
endif()
|
||||
if (Qt5WinExtras_FOUND)
|
||||
get_target_property(_winextra_prop Qt5::WinExtras IMPORTED_CONFIGURATIONS)
|
||||
get_target_property(_winextra_link_libraries Qt5::WinExtras IMPORTED_LOCATION_${_winextra_prop})
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
|
||||
get_target_property(_winextra_link_libraries Qt5::WinExtras IMPORTED_LOCATION_${BUILD_TYPE})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_winextra_link_libraries})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${Qt5WinExtras_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_FLAGS ${Qt5WinExtras_EXECUTABLE_COMPILE_FLAGS})
|
||||
|
@ -41,10 +41,21 @@ elseif(WIN32)
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
set(CPACK_BINARY_ZIP 1)
|
||||
if(MINGW)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(runtime)
|
||||
if(LYX_XMINGW)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
list(APPEND runtime /usr/${LYX_XMINGW}/lib/libwinpthread-1.dll)
|
||||
else()
|
||||
set(GCC_LIBGCC ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
get_filename_component(MINGW_RUNTIME_PATH ${GCC_LIBGCC} PATH)
|
||||
file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/*.dll)
|
||||
list(APPEND runtime ${GCC_RUNTIME} /usr/${LYX_XMINGW}/lib/libwinpthread-1.dll)
|
||||
macro(add_runtime_dll _DLL)
|
||||
file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/${_DLL})
|
||||
list(APPEND runtime ${GCC_RUNTIME})
|
||||
endmacro()
|
||||
add_runtime_dll(libgcc*.dll)
|
||||
add_runtime_dll(libstd*.dll)
|
||||
add_runtime_dll(libwin*.dll)
|
||||
if(NOT runtime)
|
||||
message(FATAL_ERROR "No mingw runtime found in ${MINGW_RUNTIME_PATH}")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user