Skip to content

Commit

Permalink
Merge pull request #182 from xmos/release/v0.2.0
Browse files Browse the repository at this point in the history
Release/v0.2.0
  • Loading branch information
shuchitak authored Feb 25, 2022
2 parents 1d80ec7 + 939a1c6 commit 724f369
Show file tree
Hide file tree
Showing 263 changed files with 13,320 additions and 3,465 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# This file contains the workflows that are run prior to merging a pull request.

name: CI
name: DOCS

on:
push:
Expand Down Expand Up @@ -46,6 +46,6 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: sw_avona_docs
path: ./doc/_build/latest/html
path: ./doc/_build/html
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 5
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "examples/bare-metal/shared_src/xscope_fileio"]
path = examples/bare-metal/shared_src/xscope_fileio
url = [email protected]:xmos/xscope_fileio
[submodule "xcore_sdk"]
path = xcore_sdk
url = [email protected]:xmos/xcore_sdk
61 changes: 19 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.20)

## Disable in-source build.
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
Expand All @@ -7,71 +7,48 @@ endif()

project(sw_avona)

## With this hack, x86 builds are work on Linux and Darwin.
if( NOT XCORE )
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 0.0.1)
endif()

## Set up the build options
include(etc/build_options.cmake)

## Fetch the Unity repo as a dependency

find_package( Python3 COMPONENTS Interpreter )

## Compile flags for C/C++ for all libs and apps (for all platforms)
list(APPEND COMPILE_FLAGS -Os -g -MMD )
list(APPEND COMPILE_FLAGS -Os -g -MMD )
list(APPEND COMPILE_FLAGS -Wno-format -Wall )

## Platform-specific C/C++ compile flags
list( APPEND COMPILE_FLAGS_XCORE -march=xs3a )
list( APPEND COMPILE_FLAGS_Linux -DX86_BUILD=1 )

list(APPEND COMPILE_FLAGS ${COMPILE_FLAGS_${CMAKE_SYSTEM_NAME}} )

## CMake configuration stuff

message( STATUS "System name here ${CMAKE_SYSTEM_NAME}" )
if( XCORE )
enable_language( C CXX XC ASM )
if(CMAKE_SYSTEM_NAME STREQUAL XCORE_XS3A)
set(XCORE_TARGET "XCORE-AI-EXPLORER")
#list(APPEND COMPILE_FLAGS -march=xs3a -mcmodel=large)
else()
enable_language( C CXX ASM )
list(APPEND COMPILE_FLAGS -DX86_BUILD=1)
endif()
## CMake configuration stuff

set( CMAKE_CXX_STANDARD 11 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )

add_compile_options( ${COMPILE_FLAGS} )

## Get build dependencies
#file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/deps)
#include(${CMAKE_SOURCE_DIR}/etc/fetch_deps.cmake)

# The path to the xcore_sdk must be set either as the CMake variable XCORE_SDK_PATH or as an
# environment variable XCORE_SDK_PATH
if(NOT DEFINED XCORE_SDK_PATH)
if(NOT DEFINED ENV{XCORE_SDK_PATH})
message(FATAL_ERROR "XCORE_SDK_PATH environment variable must be set")
endif()

set(XCORE_SDK_PATH $ENV{XCORE_SDK_PATH})
endif()

get_filename_component(XCORE_SDK_PATH ${XCORE_SDK_PATH} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})

if(NOT EXISTS ${XCORE_SDK_PATH})
message(FATAL_ERROR "xcore_sdk not present at ${XCORE_SDK_PATH}")
endif()
## Add libs and apps
add_subdirectory( xcore_sdk EXCLUDE_FROM_ALL)

message(STATUS "xcore_sdk in ${XCORE_SDK_PATH}")
message( STATUS "System name ${CMAKE_SYSTEM_NAME}" )
message( STATUS "target name ${XCORE_TARGET}" )

## Add libs and apps
add_subdirectory( modules )

if ( ${BUILD_EXAMPLES} )
if ( ${AVONA_BUILD_EXAMPLES} )
add_subdirectory( examples )
endif()

if ( ${BUILD_TESTS} )
add_subdirectory( test )
## Get build dependencies

if ( ${AVONA_BUILD_TESTS} )
include(etc/fetch_deps.cmake)
add_subdirectory( test )
endif()
Loading

0 comments on commit 724f369

Please sign in to comment.