Windows: Buildfixes
Vicki Pfau vi@endrift.com
Mon, 12 Feb 2018 22:31:48 -0800
2 files changed,
8 insertions(+),
5 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -381,6 +381,7 @@ endif()
# Feature dependencies set(FEATURE_DEFINES) +set(FEATURE_FLAGS) set(FEATURES) set(ENABLES) if(CMAKE_SYSTEM_NAME MATCHES .*BSD)@@ -506,6 +507,7 @@ else()
set(MAGICKWAND_DEB_VERSION "-6.q16-2") endif() list(APPEND FEATURE_DEFINES MAGICKWAND_VERSION_MAJOR=${MAGICKWAND_VERSION_MAJOR}) + list(APPEND FEATURE_FLAGS ${MAGICKWAND_CFLAGS_OTHER}) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libmagickwand${MAGICKWAND_DEB_VERSION}") endif()@@ -783,7 +785,7 @@ if(BUILD_SHARED)
add_library(${BINARY_NAME} SHARED ${SRC} ${VFS_SRC}) if(BUILD_STATIC) add_library(${BINARY_NAME}-static STATIC ${SRC}) - set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}") + set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}" COMPILE_OPTIONS "${FEATURE_FLAGS}") install(TARGETS ${BINARY_NAME}-static DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME}) add_dependencies(${BINARY_NAME}-static version-info) endif()@@ -792,7 +794,7 @@ add_library(${BINARY_NAME} STATIC ${SRC})
endif() add_dependencies(${BINARY_NAME} version-info) - set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}") + set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}" COMPILE_OPTIONS "${FEATURE_FLAGS}") target_link_libraries(${BINARY_NAME} ${DEBUGGER_LIB} ${DEPENDENCY_LIB} ${OS_LIB}) install(TARGETS ${BINARY_NAME} LIBRARY DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME} NAMELINK_SKIP ARCHIVE DESTINATION ${LIBDIR} RUNTIME DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
M
src/platform/qt/CMakeLists.txt
→
src/platform/qt/CMakeLists.txt
@@ -215,9 +215,6 @@ if(WIN32)
configure_file(${CMAKE_SOURCE_DIR}/res/mgba.rc.in ${CMAKE_BINARY_DIR}/res/mgba.rc) list(APPEND RESOURCES ${CMAKE_BINARY_DIR}/res/mgba.rc) set_source_files_properties(${CMAKE_BINARY_DIR}/res/mgba.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/res/mgba.ico) - if(QT_STATIC) - list(APPEND QT_LIBRARIES qwindows Qt5PlatformSupport imm32) - endif() endif() if(NOT DEFINED DATADIR) if(APPLE)@@ -273,6 +270,10 @@
list(APPEND QT_LIBRARIES Qt5::Widgets) if(BUILD_GL OR BUILD_GLES2) list(APPEND QT_LIBRARIES Qt5::OpenGL ${OPENGL_LIBRARY} ${OPENGLES2_LIBRARY}) +endif() +if(WIN32 AND QT_STATIC) + list(APPEND QT_LIBRARIES qwindows dwmapi imm32 uxtheme Qt5EventDispatcherSupport Qt5FontDatabaseSupport Qt5ThemeSupport) + set_target_properties(Qt5::Core PROPERTIES INTERFACE_LINK_LIBRARIES "qtpcre2;version;ws2_32") endif() target_link_libraries(${BINARY_NAME}-qt ${PLATFORM_LIBRARY} ${BINARY_NAME} ${QT_LIBRARIES}) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" PARENT_SCOPE)