summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2023-03-26 09:53:32 -0600
committerLinus Groh <mail@linusgroh.de>2023-03-28 09:18:50 +0100
commit4608e4143eb75e48cab81c598f37460585ce76c8 (patch)
treec641705a2018ea99118a403cc6563b5ee8cf7003
parentafb3a4a03091a728e665d2bc57ed3af413742cdd (diff)
downloadserenity-4608e4143eb75e48cab81c598f37460585ce76c8.zip
Ladybird: Improve Xcode generator experience and copy helpers to bundle
We had a mismatch in the GUI Identifier property, causing warnings in Xcode. It was also missing the Product Identifier Xcode property on ladybird itself, causing another warning. Copy all our helper processes to the ladybird.app bundle directory so that they can be found by ``open ladybird.app`` and the Xcode debugger. For the future, we should look in ../Resources for resources on macOS. Copying resources to that directory requires more CMake-fu.
-rw-r--r--Ladybird/CMakeLists.txt17
-rw-r--r--Ladybird/Info.plist2
-rw-r--r--Ladybird/Utilities.cpp4
3 files changed, 20 insertions, 3 deletions
diff --git a/Ladybird/CMakeLists.txt b/Ladybird/CMakeLists.txt
index 939f9f237b..53495a953e 100644
--- a/Ladybird/CMakeLists.txt
+++ b/Ladybird/CMakeLists.txt
@@ -113,12 +113,13 @@ target_include_directories(headless-browser PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(headless-browser PRIVATE Qt::Core LibWeb LibWebView LibWebSocket LibCrypto LibFileSystem LibGemini LibHTTP LibJS LibGfx LibMain LibTLS LibIPC LibJS)
set_target_properties(ladybird PROPERTIES
- MACOSX_BUNDLE_GUI_IDENTIFIER org.serenityos.ladybird
+ MACOSX_BUNDLE_GUI_IDENTIFIER org.SerenityOS.Ladybird
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
+ XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER org.SerenityOS.Ladybird
)
if (ANDROID)
@@ -141,7 +142,19 @@ qt_finalize_executable(ladybird)
add_subdirectory(SQLServer)
add_subdirectory(WebContent)
add_subdirectory(WebDriver)
-add_dependencies(ladybird SQLServer WebContent WebDriver)
+add_dependencies(ladybird SQLServer WebContent WebDriver headless-browser)
+
+if (APPLE)
+ # FIXME: Create a proper app bundle for each helper process
+ set(app_dir "$<TARGET_FILE_DIR:ladybird>")
+ set(bundle_dir "$<TARGET_BUNDLE_DIR:ladybird>")
+ add_custom_command(TARGET ladybird POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:SQLServer>" "${app_dir}"
+ COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:WebContent>" "${app_dir}"
+ COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:WebDriver>" "${app_dir}"
+ COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:headless-browser>" "${app_dir}"
+ )
+endif()
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/InstallRules.cmake)
diff --git a/Ladybird/Info.plist b/Ladybird/Info.plist
index 00c24b3dbc..c0a3e71b23 100644
--- a/Ladybird/Info.plist
+++ b/Ladybird/Info.plist
@@ -13,7 +13,7 @@
<key>CFBundleSignature</key>
<string></string>
<key>CFBundleExecutable</key>
- <string>Ladybird</string>
+ <string>ladybird</string>
<key>CFBundleIdentifier</key>
<string>org.SerenityOS.Ladybird</string>
<key>NSPrincipalClass</key>
diff --git a/Ladybird/Utilities.cpp b/Ladybird/Utilities.cpp
index 1c052611a6..5fb1598d27 100644
--- a/Ladybird/Utilities.cpp
+++ b/Ladybird/Utilities.cpp
@@ -52,7 +52,11 @@ void platform_init()
if (FileSystem::is_directory(home_lagom))
return home_lagom;
auto app_dir = ak_deprecated_string_from_qstring(QCoreApplication::applicationDirPath());
+# ifdef AK_OS_MACOS
+ return LexicalPath(app_dir).parent().append("Resources"sv).string();
+# else
return LexicalPath(app_dir).parent().append("share"sv).string();
+# endif
}();
#endif
}