Skip to content

Commit

Permalink
Add DESKTOP_APP_MAC_ARCH for separate macOS builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 28, 2021
1 parent 68251bb commit 410223b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions init_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@ function(init_target target_name) # init_target(my_target folder_name)
)
endif()
endfunction()

# This code is not supposed to run on build machine, only on target machine.
function(init_non_host_target target_name)
init_target(${target_name})
set_target_properties(${target_name} PROPERTIES
OSX_ARCHITECTURES "${DESKTOP_APP_MAC_ARCH}"
)
endfunction()
4 changes: 3 additions & 1 deletion validate_special_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function(report_bad_special_target)
endfunction()

set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "Minimum macOS deployment version" FORCE)
if (NOT DESKTOP_APP_QT6)
if (DESKTOP_APP_QT6)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Target macOS architectures" FORCE)
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Target macOS architectures" FORCE)
endif()

Expand Down
1 change: 1 addition & 0 deletions variables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate
option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF)
option(DESKTOP_APP_USE_ENCHANT "Use Enchant instead of bundled Hunspell. (Linux only)" OFF)
option(DESKTOP_APP_NO_PDB "Disable PDB file generation. (Windows only)" OFF)
set(DESKTOP_APP_MAC_ARCH "x86_64;arm64" CACHE STRING "Target macOS arch. (macOS only)")

set(dont_bundle_fonts 0)
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
Expand Down

0 comments on commit 410223b

Please sign in to comment.