Skip to content

Commit

Permalink
mini_analyser: fix build maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Jun 4, 2024
1 parent 0bdfbaf commit 6a7042c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 46 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/builds_minianalyser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
name: "Linux CI build"
runs-on: ubuntu-20.04
steps:
# Checkout the repository
- name: Checkout repository and submodules
# Checkout the repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v4
with:
submodules: recursive
Expand Down Expand Up @@ -77,8 +77,8 @@ jobs:
./linuxdeploy-x86_64.AppImage --appdir appdir --plugin qt --output appimage
mv ${{env.APP_NAME}}-x86_64.AppImage ../${{env.APP_NAME}}-${{env.APP_VERSION}}-linux64.AppImage
# Upload AppImage
- name: Upload AppImage
# Upload application
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-linux64.AppImage
Expand All @@ -89,8 +89,8 @@ jobs:
name: "macOS CI build"
runs-on: macos-12
steps:
# Checkout the repository
- name: Checkout repository and submodules
# Checkout the repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v4
with:
submodules: recursive
Expand Down Expand Up @@ -129,8 +129,8 @@ jobs:
make install
zip -r -X ../${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS.zip bin/${{env.APP_NAME}}.app
# Upload app zip
- name: Upload app zip
# Upload application
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS.zip
Expand All @@ -141,8 +141,8 @@ jobs:
name: "Windows CI build"
runs-on: windows-2022
steps:
# Checkout the repository
- name: Checkout repository and submodules
# Checkout the repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -152,7 +152,6 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
spectre: true

# Install Qt
- name: Install Qt
Expand Down Expand Up @@ -196,8 +195,8 @@ jobs:
mv mini_analyser/bin mini_analyser/${{env.APP_NAME}}-${{env.APP_VERSION}}-win64
7z a ../${{env.APP_NAME}}-${{env.APP_VERSION}}-win64.zip ${{env.APP_NAME}}-${{env.APP_VERSION}}-win64
# Upload app zip
- name: Upload app zip
# Upload application
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-win64.zip
Expand Down
50 changes: 25 additions & 25 deletions mini_analyser/mini_analyser.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ equals(QT_MAJOR_VERSION, 6) {
QT += core svg gui widgets svgwidgets printsupport
}

# Project files ################################################################
# Project files ----------------------------------------------------------------

SOURCES += src/main.cpp \
src/cli.cpp \
Expand Down Expand Up @@ -59,43 +59,43 @@ FORMS += ui/mainwindow.ui \
RESOURCES += resources/resources.qrc

# third party libraries
HEADERS += $${PWD}/src/thirdparty/portable_endian.h
HEADERS += src/thirdparty/portable_endian.h
include(src/thirdparty/pugixml/pugixml.pri)
include(src/thirdparty/QHexView/QHexView.pri)
include(src/thirdparty/qhexedit2/qhexedit2.pri)
include(src/thirdparty/qcustomplot/qcustomplot.pri)

# Dependencies #################################################################
# Dependencies -----------------------------------------------------------------

# minivideo library
INCLUDEPATH += ../minivideo/src/ ../../minivideo/src/
QMAKE_LIBDIR += ../minivideo/build/ ../../minivideo/build/
QMAKE_RPATHDIR += ../minivideo/build/ ../../minivideo/build/
LIBS += -lminivideo # dynamic linking
#LIBS += ../minivideo/build/libminivideo.a # static linking
INCLUDEPATH += $${PWD}/../minivideo/src/
QMAKE_LIBDIR += $${PWD}/../minivideo/bin/$${QT_ARCH}/
QMAKE_RPATHDIR += $${PWD}/../minivideo/bin/$${QT_ARCH}/
LIBS += -lminivideo # dynamic linking
#LIBS += $${PWD}/../minivideo/bin/$${QT_ARCH}/libminivideo.a # static linking

# Build settings ###############################################################
# Build artifacts --------------------------------------------------------------

unix {
# Enables AddressSanitizer
#QMAKE_CXXFLAGS += -fsanitize=address,undefined,pointer-compare,pointer-subtract -fno-omit-frame-pointer
#QMAKE_LFLAGS += -fsanitize=address,undefined,pointer-compare,pointer-subtract
}
OBJECTS_DIR = build/$${QT_ARCH}
MOC_DIR = build/$${QT_ARCH}
RCC_DIR = build/$${QT_ARCH}
UI_DIR = build/$${QT_ARCH}

DESTDIR = bin/

# Build settings ---------------------------------------------------------------

win32 { DEFINES += _USE_MATH_DEFINES }

DEFINES += QT_DEPRECATED_WARNINGS

CONFIG(release, debug|release) : DEFINES += NDEBUG QT_NO_DEBUG QT_NO_DEBUG_OUTPUT

# Build artifacts ##############################################################

OBJECTS_DIR = build/$${QT_ARCH}
MOC_DIR = build/$${QT_ARCH}
RCC_DIR = build/$${QT_ARCH}
UI_DIR = build/$${QT_ARCH}

DESTDIR = bin/$${QT_ARCH}
unix {
# Enables AddressSanitizer
#QMAKE_CXXFLAGS += -fsanitize=address,undefined,pointer-compare,pointer-subtract -fno-omit-frame-pointer
#QMAKE_LFLAGS += -fsanitize=address,undefined,pointer-compare,pointer-subtract
}

# OS specifics -----------------------------------------------------------------

Expand Down Expand Up @@ -129,10 +129,10 @@ unix {
}

# Using RPATH
QMAKE_RPATHDIR += $${PWD}/../minivideo/build
QMAKE_RPATHDIR += $${PWD}/../minivideo/bin/$${QT_ARCH}/

# Using https://nixos.org/patchelf.html
#QMAKE_POST_LINK = (patchelf --set-rpath $${PWD}/../minivideo/build/ $${PWD}/bin/mini_analyser)
#QMAKE_POST_LINK = (patchelf --set-rpath $${PWD}/../minivideo/bin/$${QT_ARCH}/ $${PWD}/bin/mini_analyser)
}

macx {
Expand Down Expand Up @@ -166,7 +166,7 @@ unix {

# Force RPATH to look into the 'Frameworks' dir (doesn't really seems to work...)
#QMAKE_RPATHDIR += @executable_path/../Frameworks
#QMAKE_RPATHDIR += $${PWD}/../minivideo/build
#QMAKE_RPATHDIR += $${PWD}/../minivideo/bin/$${QT_ARCH}/

# Rewrite minivideo rpath
#QMAKE_POST_LINK = (install_name_tool -add_rpath @executable_path/../Frameworks/. "bin/mini_analyser.app/Contents/MacOS/mini_analyser")
Expand Down
18 changes: 10 additions & 8 deletions minivideo/minivideo.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
# MiniVideo "library" build system / qmake edition
# MiniVideo library build system / qmake edition
# This file allows you to build shared & static library of MiniVideo
#-------------------------------------------------------------------------------

Expand All @@ -9,9 +9,16 @@ TEMPLATE = lib
CONFIG += c++11 shared_and_static
CONFIG -= qt

# build artifacts
# minivideo files --------------------------------------------------------------

SOURCES = $$files(src/*.cpp, true)
HEADERS = $$files(src/*.h, true)

# build artifacts --------------------------------------------------------------

OBJECTS_DIR = build/$${QT_ARCH}/
DESTDIR = build/

DESTDIR = bin/$${QT_ARCH}/

# build settings ---------------------------------------------------------------

Expand Down Expand Up @@ -78,11 +85,6 @@ win32 {
QMAKE_LFLAGS += -lm -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc
}

# minivideo files --------------------------------------------------------------

SOURCES = $$files(src/*.cpp, true)
HEADERS = $$files(src/*.h, true)

# minivideo installation -------------------------------------------------------

unix {
Expand Down

0 comments on commit 6a7042c

Please sign in to comment.