From bac68ee8619a3b6d8652cde79814db7f56bd05cc Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sat, 13 Mar 2021 14:50:59 -0600 Subject: [PATCH] Check MacOS architecture and add Intel MacOS build target --- .gitlab-ci.yml | 23 ++++++++++++++++++++++- OpenRGB.pro | 27 ++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b092abd57..e9189016b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -251,7 +251,7 @@ build_windows_64: #-----------------------------------------------------------------------# # MacOS Build Target # #-----------------------------------------------------------------------# -build_macos: +build_macos_arm64: tags: - macos stage: build @@ -271,3 +271,24 @@ build_macos: when: on_success - if: '$BUILD_MACOS =~ /.+/' when: on_success + +build_macos_intel: + tags: + - macos + stage: build + script: + - eval $(/usr/local/bin/brew shellenv) + - /usr/local/bin/qmake OpenRGB.pro + - make -j16 + - macdeployqt OpenRGB.app -codesign=OpenRGB + + artifacts: + paths: + - OpenRGB.app + expire_in: 30 days + + rules: + - if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"' + when: on_success + - if: '$BUILD_MACOS =~ /.+/' + when: on_success \ No newline at end of file diff --git a/OpenRGB.pro b/OpenRGB.pro index b1681a34c..2e31a8d6d 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -820,7 +820,28 @@ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.15 macx:ICON = qt/OpenRGB.icns -unix:macx { +macx:contains(QMAKE_HOST.arch, arm64) { + DEFINES += \ + USE_HID_USAGE \ + + SOURCES += \ + serial_port/find_usb_serial_port_linux.cpp \ + + INCLUDEPATH += \ +# /usr/local/include \ + /opt/homebrew/include \ + + LIBS += \ +# -L/usr/local/lib \ + -L/opt/homebrew/lib \ + -lusb-1.0 \ + -lhidapi \ + + CONFIG += \ + c++14 \ +} + +macx:contains(QMAKE_HOST.arch, x86_64) { DEFINES += \ USE_HID_USAGE \ @@ -829,11 +850,11 @@ unix:macx { INCLUDEPATH += \ /usr/local/include \ - /opt/homebrew/include \ +# /opt/homebrew/include \ LIBS += \ -L/usr/local/lib \ - -L/opt/homebrew/lib \ +# -L/opt/homebrew/lib \ -lusb-1.0 \ -lhidapi \