Skip to content

Commit

Permalink
add --nosr option to scons and update chmods
Browse files Browse the repository at this point in the history
  • Loading branch information
MoreTore authored and FrogAi committed Jan 30, 2024
1 parent 66f3669 commit a6f88b2
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.4
4 changes: 4 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ AddOption('--minimal',
default=os.path.islink(Dir('#rednose/').abspath), # minimal by default on release branch (where rednose is not a link)
help='the minimum build to run openpilot. no tests, tools, etc.')

AddOption('--nosr',
action='store_true',
help="don't build the screen recorder")

## Architecture name breakdown (arch)
## - larch64: linux tici aarch64
## - aarch64: linux pc aarch64
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/frogpilot/screenrecorder/screenrecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "selfdrive/ui/ui.h"

class ScreenRecorder : public QPushButton {
#ifdef WSL2
#ifdef NO_SR
public:
explicit ScreenRecorder(QWidget *parent = nullptr){}
~ScreenRecorder() override{}
Expand Down Expand Up @@ -51,5 +51,5 @@ class ScreenRecorder : public QPushButton {
BlockingQueue<QImage> image_queue;
QColor recording_color;
QWidget *rootWidget;
#endif //WSL2
#endif //NO_SR
};
13 changes: 3 additions & 10 deletions selfdrive/ui/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,13 @@ qt_src = ["main.cc", "qt/sidebar.cc", "qt/onroad.cc", "qt/body.cc",
"qt/offroad/driverview.cc", "qt/offroad/experimental_mode.cc",
"../frogpilot/screenrecorder/omx_encoder.cc", "../frogpilot/screenrecorder/screenrecorder.cc"]

def is_running_on_wsl2():
try:
with open('/proc/version', 'r') as f:
return 'WSL2' in f.read()
except FileNotFoundError:
return False

if is_running_on_wsl2():
qt_env.Append(CXXFLAGS=['-DWSL2'])
if GetOption("nosr"):
qt_env.Append(CXXFLAGS=['-DNO_SR'])
base_libs.remove('OmxCore')
qt_libs.remove('OmxCore')
qt_src.remove("../frogpilot/screenrecorder/screenrecorder.cc")
qt_src.remove("../frogpilot/screenrecorder/omx_encoder.cc")
print("Building for WSL2. Removing Screen Recorder")
print("Removing Screen Recorder")

# build translation files
with open(File("translations/languages.json").abspath) as f:
Expand Down
2 changes: 1 addition & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ poetry shell
**3. Build openpilot**

``` bash
scons -u -j$(nproc)
scons -u -j$(nproc) --nosr
```

## Dev Container on any Linux or macOS
Expand Down
Empty file modified tools/install_python_dependencies.sh
100644 → 100755
Empty file.
Empty file modified tools/install_ubuntu_dependencies.sh
100644 → 100755
Empty file.
Empty file modified tools/mac_setup.sh
100644 → 100755
Empty file.
Empty file modified tools/ubuntu_setup.sh
100644 → 100755
Empty file.

0 comments on commit a6f88b2

Please sign in to comment.