Skip to content

Commit

Permalink
Purge CONFIGURATION variable, use CONFIG+=trik_not_brick for stubs (#768
Browse files Browse the repository at this point in the history
)
  • Loading branch information
iakov committed Aug 12, 2024
1 parent 0a4e381 commit b3c87b7
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 204 deletions.
7 changes: 0 additions & 7 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ mergeable:
- do: milestone
no_empty:
enabled: true
must_include:
regex: '[0-9]+\.[0-9]+$'
- do: approvals
min:
count: 1
required:
assignees: true

- when: issues.opened
validate:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
- name: QMake
shell: msys2 {0}
run: 'qmake trikRuntime.pro -spec win32-g++ CONFIG+=tests CONFIG+=release PYTHON_PATH="${pythonLocation}" CONFIG+=force_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined'
run: 'qmake trikRuntime.pro -spec win32-g++ CONFIG+=trik_not_brick CONFIG+=tests CONFIG+=release PYTHON_PATH="${pythonLocation}" CONFIG+=force_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined'

- name: QMake all
shell: msys2 {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rockylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: QMake
timeout-minutes: 1
run: |
qmake CONFIG+=release CONFIG+=${{ matrix.nopython == 'nopython' && 'trik_nopython' || '' }} \
qmake CONFIG+=release CONFIG+=trik_not_brick CONFIG+=${{ matrix.nopython == 'nopython' && 'trik_nopython' || '' }} \
CONFIG+=tests CONFIG+=ccache CONFIG+=sanitizer \
CONFIG+=sanitize_undefined CONFIG+=${{ matrix.qjsengine == 'qjsengine' && 'trik_use_qjsengine' || '' }} \
"$GITHUB_WORKSPACE/"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/trik-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
ccache --version
qemu-arm --version
- name: "[TRIK brick] QMake"
- name: "[TRIK controller] QMake"
timeout-minutes: 1
run: |
. /opt/trik-sdk/environment-setup-arm926ejse-oe-linux-gnueabi
Expand All @@ -99,14 +99,14 @@ jobs:
qmake CONFIG+=release CONFIG+=force_debug_info CONFIG+=precompile_header \
"$GITHUB_WORKSPACE/"
- name: "[TRIK brick] QMake all"
- name: "[TRIK controller] QMake all"
timeout-minutes: 3
run: |
. /opt/trik-sdk/environment-setup-arm926ejse-oe-linux-gnueabi
cd build-brick
make -j $(nproc) qmake_all
- name: "[TRIK brick] Make all"
- name: "[TRIK controller] Make all"
timeout-minutes: 10
run: |
. /opt/trik-sdk/environment-setup-arm926ejse-oe-linux-gnueabi
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
matrix:
Linux release:
imageName: 'ubuntu-latest'
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=ccache CONFIG+=force_debug_info CONFIG+=sanitize_undefined CONFIG+=sanitizer"
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=ccache CONFIG+=force_debug_info CONFIG+=sanitize_undefined CONFIG+=trik_not_brick CONFIG+=sanitizer"
Linux debug:
imageName: 'ubuntu-latest'
CONFIG: debug
VERA: true
TRANSLATIONS: true
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=precompile_header CONFIG+=sanitize_address CONFIG+=sanitize_undefined CONFIG+=sanitizer"
QMAKE_EXTRA: "CONFIG+=trik_not_brick CONFIG+=tests CONFIG+=precompile_header CONFIG+=sanitize_address CONFIG+=sanitize_undefined CONFIG+=sanitizer"
macOs release:
imageName: 'macOS-12'
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=precompile_header CONFIG+=sanitize_address CONFIG+=sanitize_undefined CONFIG+=sanitizer CONFIG+=force_debug_info CONFIG+=trik_nopython"
QMAKE_EXTRA: "CONFIG+=trik_not_brick CONFIG+=tests CONFIG+=precompile_header CONFIG+=sanitize_address CONFIG+=sanitize_undefined CONFIG+=sanitizer CONFIG+=force_debug_info CONFIG+=trik_nopython"
TRIK_PYTHON3_VERSION_MINOR: 10
TRIK_QT_VERSION: 5.12

Expand Down
34 changes: 2 additions & 32 deletions global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,6 @@ COMPILER_IS_ARM = $$find(COMPILER, arm-.*)

PYTHONQTALL_CONFIG=PythonQtCore

count(COMPILER_IS_ARM, 1) {
ARCHITECTURE = arm
} else {
ARCHITECTURE = x86
}

win32 {
PLATFORM = windows
}

unix:!macx {
PLATFORM = linux
}

macx {
PLATFORM = mac
}

CONFIG *= qt

CONFIG -= app_bundle
Expand All @@ -74,16 +56,9 @@ CONFIG = $$unique(CONFIG)
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO *= -Og
QMAKE_CXXFLAGS_DEBUG *= -Og

CONFIG(debug) {
isEmpty(CONFIGURATION): CONFIGURATION = $$ARCHITECTURE-debug
unix {
unix:debug {
QMAKE_CXXFLAGS += -coverage
QMAKE_LFLAGS += -coverage
}
CONFIGURATION_SUFFIX=
} else {
isEmpty(CONFIGURATION): CONFIGURATION = $$ARCHITECTURE-release
CONFIGURATION_SUFFIX=
}

!gcc4:!gcc5:!clang:!win32:gcc:*-g++*:system($$QMAKE_CXX --version | grep -qEe '"\\<5\\.[0-9]+\\."' ){ CONFIG += gcc5 }
Expand All @@ -93,7 +68,7 @@ GLOBAL_PWD = $$absolute_path($$PWD)
GLOBAL_OUTPWD = $$absolute_path($$OUT_PWD)

isEmpty(GLOBAL_DESTDIR) {
GLOBAL_DESTDIR = $$GLOBAL_OUTPWD/bin/$$CONFIGURATION
GLOBAL_DESTDIR = $$GLOBAL_OUTPWD/bin
}
isEmpty(DESTDIR) {
DESTDIR = $$GLOBAL_DESTDIR
Expand Down Expand Up @@ -222,11 +197,6 @@ macx-clang {
}
}

OBJECTS_DIR = .build/$$CONFIGURATION/obj
MOC_DIR = .build/$$CONFIGURATION/moc
RCC_DIR = .build/$$CONFIGURATION/rcc
UI_DIR = .build/$$CONFIGURATION/ui

precompile_header {
PRECOMPILED_HEADER = $$PWD/pch.h
QMAKE_CXXFLAGS *= -Wno-error=invalid-pch
Expand Down
12 changes: 5 additions & 7 deletions mlx90640-library/mlx90640-library.pro
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ HEADERS += \
SOURCES += \
$$PWD/mlx90640-library/functions/MLX90640_API.cpp

linux-* {
SOURCES += \
$$PWD/mlx90640-library/functions/MLX90640_LINUX_I2C_Driver.cpp
}

!linux-* {
SOURCES += \
trik_not_brick {
SOURCES += \
$$PWD/src/MLX90640_STUB_I2C_Driver.cpp
} else {
SOURCES += \
$$PWD/mlx90640-library/functions/MLX90640_LINUX_I2C_Driver.cpp
}

2 changes: 1 addition & 1 deletion scripts/azure/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export MSAN_OPTIONS=poison_in_dtor=1

for t in "$@"
do
cd $BUILDDIR/bin/x86-$CONFIG
cd $BUILDDIR/bin
errCode=0
if [ $AGENT_OS = linux ] ; then
ulimit -c unlimited
Expand Down
4 changes: 2 additions & 2 deletions scripts/azure/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ $EXECUTOR bash -lic " set -x; \
&& env TRIK_PYTHONPATH=\`python3.\${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))'\` \
PYTHONMALLOC=malloc \
ASAN_OPTIONS=disable_coredump=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0:use_sigaltstack=0 \
LSAN_OPTIONS=suppressions=\$PWD/bin/x86-$CONFIG/lsan.supp:fast_unwind_on_malloc=0 \
LSAN_OPTIONS=suppressions=\$PWD/bin/lsan.supp:fast_unwind_on_malloc=0 \
MSAN_OPTIONS=poison_in_dtor=1 \
QT_QPA_PLATFORM=minimal \
make -k -j 2 check \
&& ls bin/x86-$CONFIG "
&& ls bin"


exec bash -c 'eval timeout -k 10s 100s $EXECUTOR scripts/azure/runtests.sh trikKernelTests trikCameraPhotoTests trikCommunicatorTests trikJsRunnerTests $([ -x ./trikPyRunnerTests ] && echo trikPyRunnerTests || : )'
2 changes: 1 addition & 1 deletion scripts/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ for t in "$@"
MSAN_OPTIONS=poison_in_dtor=1 \
TRIK_PYTHONPATH=$TRIK_PYTHONPATH \
sh -xc \
"cd $BUILDDIR/bin/x86-$CONFIG && \
"cd $BUILDDIR/bin && \
{ \
errCode=0 ; \
if [ $TRAVIS_OS_NAME = linux ] ; then ulimit -c unlimited ; echo core > /proc/sys/kernel/core_pattern ; echo 0 > /proc/sys/kernel/core_uses_pid; fi ; \
Expand Down
2 changes: 1 addition & 1 deletion scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $EXECUTOR bash -lic " set -x; \
DISPLAY=:0 \
PYTHONMALLOC=malloc \
ASAN_OPTIONS=disable_coredump=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0:symbolize=1:use_sigaltstack=0 \
LSAN_OPTIONS=suppressions=\$PWD/bin/x86-$CONFIG/lsan.supp:fast_unwind_on_malloc=0 \
LSAN_OPTIONS=suppressions=\$PWD/bin/lsan.supp:fast_unwind_on_malloc=0 \
MSAN_OPTIONS=poison_in_dtor=1 \
make check -k -j2 \
&& ls bin/x86-$CONFIG"
Expand Down
45 changes: 1 addition & 44 deletions trikControl/trikControlExport.pri
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,14 @@ if (equals(QT_MAJOR_VERSION, 5)) {

COMPILER = $$(CXX)

COMPILER_IS_ARM = $$find(COMPILER, arm-oe.*)

count(COMPILER_IS_ARM, 1) {
ARCHITECTURE = arm
} else {
ARCHITECTURE = x86
}

win32 {
PLATFORM = windows
} else {
PLATFORM = linux
}

CONFIG(debug, debug | release) {
CONFIGURATION = $$ARCHITECTURE-debug
CONFIGURATION_SUFFIX = -d
} else {
CONFIGURATION = $$ARCHITECTURE-release
CONFIGURATION_SUFFIX =
}

equals(TEMPLATE, app) {
!macx {
QMAKE_LFLAGS += -Wl,-O1,-rpath,.
QMAKE_LFLAGS += -Wl,-rpath-link,$$DESTDIR
}
}

isEmpty(TRIK_RUNTIME_BIN_DIR):TRIK_RUNTIME_BIN_DIR = $$TRIK_RUNTIME_DIR/bin/$$CONFIGURATION
isEmpty(TRIK_RUNTIME_BIN_DIR):TRIK_RUNTIME_BIN_DIR = $$TRIK_RUNTIME_DIR/bin

LIBS += -L$$TRIK_RUNTIME_BIN_DIR

Expand Down Expand Up @@ -129,24 +107,3 @@ copyToDestdir( \
$$PWD/system-config.xml \
$$PWD/../media/ \
)

# Compiler swithces to enable Google Sanitizers support.
unix:equals(ARCHITECTURE, "x86") {
CONFIG(debug) {
QMAKE_CXXFLAGS += -fno-omit-frame-pointer
CONFIG(sanitize-address) {
QMAKE_CXXFLAGS += -fsanitize=address
QMAKE_LFLAGS += -fsanitize=address
}
CONFIG(sanitize-undefined) {
# UBSan does not play well with precompiled headers for some reason.
QMAKE_CXXFLAGS += -fsanitize=undefined
QMAKE_LFLAGS += -fsanitize=undefined
}
CONFIG(sanitize-thread) {
QMAKE_CXXFLAGS += -fsanitize=thread
QMAKE_LFLAGS += -fsanitize=thread
LIBS += -ltsan
}
}
}
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion trikGui/trikGui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,22 @@ SOURCES += \
$$PWD/sensorLever.cpp \
$$PWD/scriptHolder.cpp \
$$PWD/gamepadIndicator.cpp \
$$PWD/$$PLATFORM/powerLevel.cpp \
$$PWD/gyroscopeIndicator.cpp \
$$PWD/accelerometerWidget.cpp \
$$PWD/networkWidget.cpp \
$$PWD/fileSystemFilter.cpp \
$$PWD/cameraWidget.cpp \
$$PWD/pwmCaptureIndicator.cpp



!trik_not_brick {
SOURCES += $$PWD/powerLevel.cpp
} else {
SOURCES += $$PWD/powerLevel_stub.cpp
}


RESOURCES = trikGui.qrc

OTHER_FILES += \
Expand Down
22 changes: 0 additions & 22 deletions trikGui/windows/powerLevel.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion trikHal/trikHal.pro
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ SOURCES += \
$$PWD/src/stub/stubFifo.cpp \
$$PWD/src/stub/stubIIOFile.cpp \

equals(ARCHITECTURE, arm):!trik_not_brick {
!trik_not_brick {
SOURCES += $$PWD/src/trik/hardwareAbstractionFactory.cpp
} else {
SOURCES += $$PWD/src/stub/hardwareAbstractionFactory.cpp
Expand Down
11 changes: 9 additions & 2 deletions trikKernel/trikKernel.pro
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,19 @@ SOURCES += \
$$PWD/src/loggingHelper.cpp \
$$PWD/src/rcReader.cpp \
$$PWD/src/translationsHelper.cpp \
$$PWD/src/$$PLATFORM/coreDumping.cpp \


macx { PLATFORM = mac } else:win32 { PLATFORM = windows } else:PLATFORM = linux



SOURCES += $$PWD/src/$$PLATFORM/coreDumping.cpp \


OTHER_FILES += \
$$PWD/stubTrikRc \

equals(ARCHITECTURE, arm):!trik_not_brick {
!trik_not_brick {
SOURCES += $$PWD/src/trik/paths.cpp
} else {
SOURCES += $$PWD/src/stub/paths.cpp
Expand Down
Loading

0 comments on commit b3c87b7

Please sign in to comment.