Skip to content

Build on mac #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions .github/workflows/action-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
distro: ubuntu_latest
- arch: riscv64
distro: ubuntu_latest
- arch: aarch64
distro: fedora_latest
- arch: ppc64le
distro: fedora_latest
- arch: s390x
distro: fedora_latest
# - arch: aarch64
# distro: fedora_latest
# - arch: ppc64le
# distro: fedora_latest
# - arch: s390x
# distro: fedora_latest
steps:
- name: Get current date
id: date
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Set artifacts dir
id: artifacts
run: echo "artifacts=$(echo $PWD/artifacts)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: configure-and-build
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
id: get-version
run: echo "prj_ver=$(cat ${PWD}/artifacts/VERSION.txt)" >> $GITHUB_OUTPUT
- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}-{2}', steps.get-version.outputs.prj_ver, matrix.distro, matrix.arch) }}
path: ${{ format('{0}/Qldd-{1}-{2}.???', steps.artifacts.outputs.artifacts ,steps.get-version.outputs.prj_ver, matrix.arch) }}
Expand All @@ -85,6 +85,7 @@ jobs:
matrix:
container:
- ubuntu:22.04
- ubuntu:24.04

container:
image: ${{ matrix.container }}
Expand All @@ -96,7 +97,7 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: devel-pkgs
run: apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++ lsb-release
Expand All @@ -115,15 +116,15 @@ jobs:
- name: cpack
run: cd cmake-build-release && cpack -G DEB && cd ..
# upload artifact
- uses: mad9000/actions-find-and-replace-string@3
- uses: mad9000/actions-find-and-replace-string@5
id: container
with:
source: ${{ matrix.container }}
find: ':' # we want to remove : from container name
replace: '-' # and replace it with -

- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }}
path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }}
Expand All @@ -148,7 +149,7 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: devel-pkgs
run: |
Expand All @@ -169,15 +170,15 @@ jobs:
- name: cpack
run: cd cmake-build-release && cpack -G DEB && cd ..
# upload artifact
- uses: mad9000/actions-find-and-replace-string@3
- uses: mad9000/actions-find-and-replace-string@5
id: container
with:
source: ${{ matrix.container }}
find: ':' # we want to remove : from container name
replace: '-' # and replace it with -

- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }}
path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }}
Expand All @@ -202,7 +203,7 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: devel-pkgs
run: apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++ lsb-release
Expand All @@ -221,15 +222,15 @@ jobs:
- name: cpack
run: cd cmake-build-release && cpack -G DEB && cd ..
# upload artifact
- uses: mad9000/actions-find-and-replace-string@3
- uses: mad9000/actions-find-and-replace-string@5
id: container
with:
source: ${{ matrix.container }}
find: ':' # we want to remove : from container name
replace: '-' # and replace it with -

- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }}
path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }}
Expand All @@ -254,7 +255,7 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: devel-pkgs
run: apt-get update -y && apt-get install -yq binutils python-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++ lsb-release
Expand All @@ -273,15 +274,15 @@ jobs:
- name: cpack
run: cd cmake-build-release && cpack -G DEB && cd ..
# upload artifact
- uses: mad9000/actions-find-and-replace-string@3
- uses: mad9000/actions-find-and-replace-string@5
id: container
with:
source: ${{ matrix.container }}
find: ':' # we want to remove : from container name
replace: '-' # and replace it with -

- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }}
path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }}
Expand All @@ -306,7 +307,7 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: devel-pkgs
run: |
Expand All @@ -331,15 +332,15 @@ jobs:
- name: cpack
run: cd cmake-build-release && cpack -G RPM && cd ..
# upload artifact
- uses: mad9000/actions-find-and-replace-string@3
- uses: mad9000/actions-find-and-replace-string@5
id: container
with:
source: ${{ matrix.container }}
find: ':' # we want to remove : from container name
replace: '-' # and replace it with -

- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }}
path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }}
Expand All @@ -364,7 +365,7 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: devel-pkgs
run: yum update -y && yum install -yq binutils python3-nautilus qt5-qtbase-devel qt5-qttools rpm-build redhat-lsb
Expand All @@ -383,15 +384,15 @@ jobs:
- name: cpack
run: cd cmake-build-release && cpack -G RPM && cd ..
# upload artifact
- uses: mad9000/actions-find-and-replace-string@3
- uses: mad9000/actions-find-and-replace-string@5
id: container
with:
source: ${{ matrix.container }}
find: ':' # we want to remove : from container name
replace: '-' # and replace it with -

- name: Upload Qldd binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}.{1}', steps.get-version.outputs.prj_ver, steps.container.outputs.value) }}
path: cmake-build-release/${{ format('Qldd-{0}-x86_64.???', steps.get-version.outputs.prj_ver) }}
Expand All @@ -406,15 +407,15 @@ jobs:
- name: Get commit sha
id: git_sha
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# install dependencies
- name: brew-pkgs
run: brew install qt@5
# build project
- name: mkdir
run: mkdir cmake-build-release
- name: cmake cmake-build-release
run: cmake -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/qt5 -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
run: cmake -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/qt@5 -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
- name: cmake make
run: cmake --build cmake-build-release/ --target all
env:
Expand All @@ -424,7 +425,7 @@ jobs:
run: echo "prj_ver=$(cat ./VERSION.txt)" >> $GITHUB_OUTPUT
- name: cpack
run: cd cmake-build-release && cpack -G DragNDrop && cd ..
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ format('Qldd-{0}-Darwin.dmg', steps.get-version.outputs.prj_ver) }}
path: cmake-build-release/${{ format('Qldd-{0}-Darwin.dmg', steps.get-version.outputs.prj_ver) }}
Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Threads REQUIRED)

set(QtVerPath qt5)
set(QtVerPath qt@5)
if (FORCE_QT6)
set(QtVer Qt6)
set(QtVerPath qt6)
set(QtVerPath qt@6)
find_package(${QtVer} COMPONENTS Widgets REQUIRED)
else()
set(QtVer Qt5)
find_package(${QtVer} COMPONENTS Widgets QUIET)
if (NOT Qt5_FOUND)
set(QtVer Qt6)
set(QtVerPath qt6)
set(QtVerPath qt@6)
find_package(${QtVer} COMPONENTS Widgets REQUIRED)
endif ()
endif()
Expand Down Expand Up @@ -163,6 +163,10 @@ if(APPLE)
OUTPUT_VARIABLE brew_path)

string(STRIP ${brew_path} brew_path)
link_directories("${brew_path}/lib")
add_custom_command(TARGET Qldd
POST_BUILD
COMMAND ln -s "${brew_path}/lib" "lib")
add_custom_command(TARGET Qldd
POST_BUILD
COMMAND "${brew_path}/opt/${QtVerPath}/bin/macdeployqt" Qldd.app)
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void MainWindow::initDemangleRules() {
QJsonDocument doc = QJsonDocument::fromJson(val.toUtf8());
QJsonObject obj = doc.object();
QJsonArray arrRules = obj["rules"].toArray();
for (const auto &item : qAsConst(arrRules)) {
for (const auto &item : arrRules) {
auto itemObj = item.toObject();
auto itemKeys = itemObj.keys();
if (itemKeys.size() == 1) {
Expand Down
6 changes: 3 additions & 3 deletions qldd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void QLdd::fillDependency(QTreeWidget &treeWidget) {
sl = line.split(DEPEND_SPLITTER);
}
int i = 0;
for (const QString &v : qAsConst(sl)) {
for (const QString &v : sl) {
if (v.contains("(0x") || v.contains("(compatibility")) {
QStringList slTmp = v.split("(");
if (slTmp.size() > 1) {
Expand Down Expand Up @@ -122,7 +122,7 @@ void QLdd::fillDependency(QTreeWidget &treeWidget) {
sl.removeFirst();
QTreeWidgetItem *tmp = item;
QColor redC("red");
for (const QString &v : qAsConst(sl)) {
for (const QString &v : sl) {
if (!v.trimmed().isEmpty()) {
if (v.contains("not found")) {
tmp->setForeground(0, QBrush(redC));
Expand Down Expand Up @@ -191,7 +191,7 @@ QString QLdd::getInfo() {
execAndDoOnEveryLine(ss.str(), [&buf](const QString &line) { buf.append(line + "\n"); });
QStringList slTmp = buf.split(INFO_SPLITTER);
buf.clear();
for (const QString &v : qAsConst(slTmp)) {
for (const QString &v : slTmp) {
buf.append(v.trimmed()).append("\n");
}
return buf;
Expand Down