Skip to content

Commit

Permalink
Split envs for 32 and 64 bit builds, close lvgl#31
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed Feb 2, 2021
1 parent 4f1dc9a commit 26eecc1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
47 changes: 35 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,46 @@ jobs:
steps:
- name: Install Linux dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libsdl2-dev:i386 gcc-multilib g++-multilib
sudo apt-get install libsdl2-dev
- uses: actions/checkout@v2
- uses: actions/setup-python@v1

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install -U platformio
platformio update
- name: Build bare metal (stm32f429_disco)
run: platformio run -e stm32f429_disco

- name: Build native (sdl2)
run: platformio run -e native
- name: Build emulator (sdl2, 64bits)
run: platformio run -e emulator_64bits


Linux_i386:
runs-on: ubuntu-latest
steps:
- name: Install Linux dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libsdl2-dev:i386 gcc-multilib g++-multilib
- uses: actions/checkout@v2
- uses: actions/setup-python@v1

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install -U platformio
platformio update
- name: Build emulator (sdl2, 32bits)
run: platformio run -e emulator_32bits


macOS:
runs-on: macos-latest
Expand All @@ -40,18 +62,19 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install -U platformio
platformio update
- name: Build bare metal (stm32f429_disco)
run: platformio run -e stm32f429_disco

- name: Build native (sdl2)
run: platformio run -e native
- name: Build emulator (sdl2, 64bits)
run: platformio run -e emulator_64bits


Windows:
runs-on: windows-latest
Expand All @@ -78,5 +101,5 @@ jobs:
- name: Build bare metal (stm32f429_disco)
run: platformio run -e stm32f429_disco

- name: Build native (sdl2)
run: platformio run -e native
- name: Build emulator (sdl2, 64bits)
run: platformio run -e emulator_64bits
14 changes: 9 additions & 5 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; http://docs.platformio.org/page/projectconf.html

[platformio]
default_envs = native
default_envs = emulator_64bits

; Shared options
[env]
Expand All @@ -24,16 +24,13 @@ lib_deps =
lib_archive = false


[env:native]
[env:emulator_64bits]
platform = native@^1.1.3
extra_scripts = support/sdl2_build_extra.py
build_flags =
${env.build_flags}
-D LV_LOG_LEVEL=LV_LOG_LEVEL_INFO
-D LV_LOG_PRINTF=1
; Use 32-bits build when possible, for correct memory stat display. You need
; `:i386` sdl2 libs installed. Comment this option for 64-bits build.
!python -c "import platform; print('-m32' if platform.system() in [ 'Linux' ] else '')"
; Add recursive dirs for hal headers search
!python -c "import os; print(' '.join(['-I {}'.format(i[0].replace('\x5C','/')) for i in os.walk('hal/sdl2')]))"
-lSDL2
Expand All @@ -54,6 +51,13 @@ src_filter =
+<../hal/sdl2>


[env:emulator_32bits]
extends = env:emulator_64bits
build_flags =
${env:emulator_64bits.build_flags}
-m32


[env:stm32f429_disco]
platform = ststm32@^8.0.0
board = disco_f429zi
Expand Down
4 changes: 2 additions & 2 deletions support/sdl2_build_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
e.Append(LINKFLAGS = ["-m32"])

# Override unused "upload" to execute compiled binary
#from SCons.Script import AlwaysBuild
#AlwaysBuild(env.Alias("upload", "$BUILD_DIR/${PROGNAME}", "$BUILD_DIR/${PROGNAME}"))
from SCons.Script import AlwaysBuild
AlwaysBuild(env.Alias("upload", "$BUILD_DIR/${PROGNAME}", "$BUILD_DIR/${PROGNAME}"))

# Add custom target to explorer
env.AddTarget(
Expand Down

0 comments on commit 26eecc1

Please sign in to comment.