Skip to content

Commit

Permalink
Travis-CI: Enable RISC-V32 project compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-Chouteau committed Jul 11, 2018
1 parent eb8f8b4 commit 4cb4825
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -9,6 +9,7 @@ env:
- TOOLS_DIR=$HOME/build_tools
- GNAT_BIN_PATH=$TOOLS_DIR/gnat-community-2018-x86_64-linux-bin
- GNAT_ARM_BIN_PATH=$TOOLS_DIR/gnat-community-2018-arm-elf-bin
- GNAT_RV32_BIN_PATH=$TOOLS_DIR/gnat-community-2018-riscv32-elf-bin
- INSTALL_CONTROL_SCRIPT=$PWD/scripts/GNAT_CE_2018_install_control.qs

os:
Expand All @@ -25,21 +26,25 @@ install:
# not, download it.
- test -f $GNAT_BIN_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/5b0d7bffa3f5d709751e3e04 -O $GNAT_BIN_PATH)
- test -f $GNAT_ARM_BIN_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/5b0c1227a3f5d7097625478d -O $GNAT_ARM_BIN_PATH)
- test -f $GNAT_RV32_BIN_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/5b0c154aa3f5d70976254791 -O $GNAT_RV32_BIN_PATH)

- wget https://raw.githubusercontent.com/AdaCore/gnat_community_install_script/master/install_package.sh
- wget https://raw.githubusercontent.com/AdaCore/gnat_community_install_script/master/install_script.qs

- sh install_package.sh $GNAT_BIN_PATH $TOOLS_DIR/native/
- sh install_package.sh $GNAT_ARM_BIN_PATH $TOOLS_DIR/arm-elf/
- sh install_package.sh $GNAT_RV32_BIN_PATH $TOOLS_DIR/riscv32-elf/

# Add GNAT to $PATH
- export PATH=$PATH:$TOOLS_DIR/native/bin/
- export PATH=$PATH:$TOOLS_DIR/arm-elf/bin/
- export PATH=$PATH:$TOOLS_DIR/riscv32-elf/bin/

script:
# Show GNAT version for the record
- $TOOLS_DIR/native/bin/gprbuild --version
- $TOOLS_DIR/arm-elf/bin/gprbuild --version
- $TOOLS_DIR/riscv32-elf/bin/gprbuild --version

# Install extra run-times
- python $PWD/scripts/install_dependencies.py
Expand Down
8 changes: 7 additions & 1 deletion scripts/build_all_examples.py
Expand Up @@ -5,7 +5,7 @@
import os.path
import subprocess
import sys

import distutils.spawn

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))

Expand Down Expand Up @@ -146,6 +146,12 @@ def gprbuild(project_file, debug=False):
STM_DRIVERS + "/demo_usart_polling/demo_usart_polling.gpr",
]

# Check if RISC-V32 compiler is available
if distutils.spawn.find_executable("riscv32-elf-gnatls"):

# Add RISC-V32 projects
projects += ["/examples/HiFive1/hifive1_example.gpr"]

parser = argparse.ArgumentParser('Compile all the Ada_Drivers_Library examples')

parser.add_argument(
Expand Down

0 comments on commit 4cb4825

Please sign in to comment.