Internal
Public Access
Windows: deploy sqlite3.dll and mark orbithub as a GUI (WIN32) executable
Two more Windows launch issues found alongside the Qt plugin deployment: vcpkg's qtbase[sql-sqlite] links the QSQLITE driver plugin against vcpkg's own shared sqlite3 port rather than bundling it, so the plugin was found but failed to load without sqlite3.dll alongside the executable. Separately, plain add_executable() defaults to the console subsystem on Windows, so a command-prompt window appeared behind the GUI on every launch; add_executable needs the WIN32 keyword to mark it as a GUI app (a no-op on other platforms). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+20
-1
@@ -78,7 +78,7 @@ set(WITH_WINPR_TOOLS OFF CACHE BOOL "" FORCE)
|
|||||||
|
|
||||||
add_subdirectory(third_party/FreeRDP EXCLUDE_FROM_ALL)
|
add_subdirectory(third_party/FreeRDP EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
add_executable(orbithub
|
add_executable(orbithub WIN32
|
||||||
src/about_dialog.cpp
|
src/about_dialog.cpp
|
||||||
src/about_dialog.h
|
src/about_dialog.h
|
||||||
src/app_icon.cpp
|
src/app_icon.cpp
|
||||||
@@ -162,6 +162,25 @@ if(WIN32)
|
|||||||
install(FILES "$<TARGET_FILE:Qt6::QSQLiteDriverPlugin>"
|
install(FILES "$<TARGET_FILE:Qt6::QSQLiteDriverPlugin>"
|
||||||
DESTINATION "${CMAKE_INSTALL_BINDIR}/sqldrivers"
|
DESTINATION "${CMAKE_INSTALL_BINDIR}/sqldrivers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# vcpkg's qtbase[sql-sqlite] links the plugin against vcpkg's own
|
||||||
|
# shared sqlite3 port rather than bundling SQLite into the plugin,
|
||||||
|
# so the plugin fails to load ("can not load requested driver
|
||||||
|
# 'QSQLITE'") unless sqlite3.dll also ships next to the executable.
|
||||||
|
find_file(ORBITHUB_SQLITE3_DLL
|
||||||
|
NAMES sqlite3.dll
|
||||||
|
PATHS ${CMAKE_PREFIX_PATH}
|
||||||
|
PATH_SUFFIXES bin
|
||||||
|
)
|
||||||
|
if(ORBITHUB_SQLITE3_DLL)
|
||||||
|
add_custom_command(TARGET orbithub POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
"${ORBITHUB_SQLITE3_DLL}"
|
||||||
|
"$<TARGET_FILE_DIR:orbithub>/"
|
||||||
|
COMMENT "Deploying sqlite3.dll (Qt SQLite plugin dependency)"
|
||||||
|
)
|
||||||
|
install(FILES "${ORBITHUB_SQLITE3_DLL}" DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user