Add macOS runtime bins. Try to link the GTK Mac integration lib

master
Melroy van den Berg 2022-02-13 23:03:55 +01:00
parent a80d47a801
commit c86f642413
No known key found for this signature in database
GPG Key ID: 71D11FF23454B9D7
13 changed files with 28 additions and 6 deletions

View File

@ -18,6 +18,7 @@ jobs:
run: | run: |
brew install \ brew install \
gtkmm3 \ gtkmm3 \
gtk-mac-integration \
ninja ninja
# Workaround for now, we create our own features.h file (macos image either is missing this file, or some include folder is missing during the build) # Workaround for now, we create our own features.h file (macos image either is missing this file, or some include folder is missing during the build)
@ -38,8 +39,4 @@ jobs:
with: with:
name: macOS-dmg-package name: macOS-dmg-package
path: build_prod_macos/libreweb-browser-v*.dmg path: build_prod_macos/libreweb-browser-v*.dmg
#xcodebuild \
# -project "libreweb-browser.xcodeproj" \
# -scheme libreweb-browser \
# -configuration Debug

View File

@ -218,7 +218,8 @@ For more info, see also: [Windows readme file](windows.md).
* Brew (`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`) * Brew (`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`)
* CMake (brew: `cmake`) * CMake (brew: `cmake`)
* Libcurl (brew: `curl`) * Libcurl (brew: `curl`)
* Gtk3/Gtkmm3 (brew: `gtkmm3`) * Gtk3/Gtkmm3 (brew: `gtkmm3`)
* GTK Mac Integration (brew: `gtk-mac-integration`)
* Ninja (brew: `ninja`) * Ninja (brew: `ninja`)
#### MacOS Build #### MacOS Build

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
misc/packaging_macos/bin/gdbus Executable file

Binary file not shown.

View File

@ -7,6 +7,15 @@ mkdir build_prod_macos
cd build_prod_macos cd build_prod_macos
cmake -G Ninja -DDOXYGEN:BOOL=FALSE -DCMAKE_BUILD_TYPE=Release .. cmake -G Ninja -DDOXYGEN:BOOL=FALSE -DCMAKE_BUILD_TYPE=Release ..
# TODO:
# cmake -G Xcode -DCODE_SIGN_IDENTITY="codesign ID..." -DDEVELOPMENT_TEAM_ID="team ID..."
#TODO: xcodebuild \
# -project "libreweb-browser.xcodeproj" \
# -scheme libreweb-browser \
# -configuration Release
ninja && ninja &&
echo "INFO: Start Drag & Drop packaging for MacOS..."; echo "INFO: Start Drag & Drop packaging for MacOS...";
cpack -C Release -G DragNDrop cpack -C Release -G DragNDrop

View File

@ -7,6 +7,10 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0) pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
# Only for macOS
if(APPLE)
pkg_check_modules(MAC_INTEGRATION REQUIRED gtk-mac-integration-gtk3)
endif()
# Generate Project version header file # Generate Project version header file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/project_config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/project_config.h)
@ -130,6 +134,17 @@ if(NOT UNITTEST)
nlohmann_json::nlohmann_json nlohmann_json::nlohmann_json
) )
target_compile_options(${PROJECT_TARGET} PRIVATE ${GTKMM_CFLAGS_OTHER}) target_compile_options(${PROJECT_TARGET} PRIVATE ${GTKMM_CFLAGS_OTHER})
if (APPLE)
# Add GTK Mac Integration for macOS
target_include_directories(${PROJECT_TARGET} PRIVATE ${MAC_INTEGRATION_INCLUDE_DIRS})
target_link_libraries(${PROJECT_TARGET} PRIVATE ${MAC_INTEGRATION_LIBRARIES})
target_compile_options(${PROJECT_TARGET} PRIVATE ${MAC_INTEGRATION_CFLAGS_OTHER})
# Sign target for macOS
set_target_properties(${PROJECT_TARGET} PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${CODE_SIGN_IDENTITY}
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${DEVELOPMENT_TEAM_ID}
)
endif()
# Install browser binary # Install browser binary
install(TARGETS ${PROJECT_TARGET} RUNTIME DESTINATION bin) install(TARGETS ${PROJECT_TARGET} RUNTIME DESTINATION bin)