Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bootstrap - Create new C/C++ projects with reference to the upstream tooling #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
cmake_minimum_required(VERSION 3.3)

# include additional cmake
include(utils/cmake/JSONParser.cmake)
include(utils/cmake/util.cmake)
include(utils/cmake/colours.cmake)
set( CORE_PATH "libraries/codal" )
include(${CORE_PATH}/utils/cmake/JSONParser.cmake)
include(${CORE_PATH}/utils/cmake/util.cmake)
include(${CORE_PATH}/utils/cmake/colours.cmake)

if (NOT "${BUILD_TOOL}" STRGREATER "")
set(BUILD_TOOL "CODAL")
Expand Down Expand Up @@ -95,7 +96,7 @@ endif()
####################

SET(TOOLCHAIN ${device.toolchain})
SET(TOOLCHAIN_FOLDER "${CMAKE_CURRENT_LIST_DIR}/utils/cmake/toolchains/${device.toolchain}")
SET(TOOLCHAIN_FOLDER "${CMAKE_CURRENT_LIST_DIR}/${CORE_PATH}/utils/cmake/toolchains/${device.toolchain}")

# include toolchain file
set(CMAKE_TOOLCHAIN_FILE "${TOOLCHAIN_FOLDER}/toolchain.cmake" CACHE PATH "toolchain file")
Expand All @@ -106,7 +107,7 @@ enable_language(ASM)

# include compiler flags overrides
include(${TOOLCHAIN_FOLDER}/compiler-flags.cmake)
set(PLATFORM_INCLUDES_PATH "${PROJECT_SOURCE_DIR}/utils/cmake/toolchains/${device.toolchain}")
set(PLATFORM_INCLUDES_PATH "${PROJECT_SOURCE_DIR}/${CORE_PATH}/utils/cmake/toolchains/${device.toolchain}")

file(MAKE_DIRECTORY "${PROJECT_SOURCE_DIR}/build")

Expand Down Expand Up @@ -193,7 +194,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${PLATFORM_INCLUDES_PATH}")
set(CODAL_BUILD_SYSTEM TRUE)

# a define specificying common utils used in codal
set(CODAL_UTILS_LOCATION "${PROJECT_SOURCE_DIR}/utils/cmake/util.cmake")
set(CODAL_UTILS_LOCATION "${PROJECT_SOURCE_DIR}/${CORE_PATH}/utils/cmake/util.cmake")

# this variable is used in the linking step of the final binary.
set(LIB_FOLDERS "")
Expand Down Expand Up @@ -268,12 +269,12 @@ endif()
if ("${BUILD_TOOL}" STRGREATER "")
string(COMPARE EQUAL "${BUILD_TOOL}" "YOTTA" YOTTA_BUILD)
if (${YOTTA_BUILD})
include("${PROJECT_SOURCE_DIR}/utils/cmake/buildtools/yotta.cmake")
include("${PROJECT_SOURCE_DIR}/${CORE_PATH}/utils/cmake/buildtools/yotta.cmake")
endif ()

string(COMPARE EQUAL "${BUILD_TOOL}" "CODAL" CODAL_BUILD)
if (${CODAL_BUILD})
include("${PROJECT_SOURCE_DIR}/utils/cmake/buildtools/codal.cmake")
include("${PROJECT_SOURCE_DIR}/${CORE_PATH}/utils/cmake/buildtools/codal.cmake")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# out of source build!
os.chdir("build")

test_json = read_json("../utils/targets.json")
test_json = read_json("../libraries/codal/utils/targets.json")

# configure the target a user has specified:
if len(args) == 1:
Expand Down
3 changes: 3 additions & 0 deletions utils/cmake/toolchains/ARM_GCC/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ find_program(ARM_NONE_EABI_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_OSX_SYSROOT "/")
set(CMAKE_OSX_DEPLOYMENT_TARGET "")

set(CMAKE_SYSTEM_NAME "Generic")
set(CMAKE_SYSTEM_VERSION "2.0.0")

set(CODAL_TOOLCHAIN "ARM_GCC")

if(CMAKE_VERSION VERSION_LESS "3.5.0")
Expand Down
2 changes: 1 addition & 1 deletion utils/python/codal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def update():

def printstatus():
print("\n***%s" % os.getcwd())
system("git status -s")
system("git status -sb")

def status():
(codal, targetdir, target) = read_config()
Expand Down