-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from xmos/develop
Merge to main for release v0.2.0
- Loading branch information
Showing
15 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
title: XCommon CMake | ||
project: xcommon_cmake | ||
version: 0.1.0 | ||
version: 0.2.0 | ||
documentation: | ||
pdfs: | ||
index: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Application requires source file foo.c which is generated in the build directory by a cmake echo command. |
14 changes: 14 additions & 0 deletions
14
tests/generated_source_file/app_generated_source_file/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
include($ENV{XMOS_CMAKE_PATH}/xcommon.cmake) | ||
project(generated_source_file) | ||
|
||
set(APP_HW_TARGET XCORE-AI-EXPLORER) | ||
|
||
XMOS_REGISTER_APP() | ||
|
||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/generated) | ||
add_custom_target(foo.c | ||
${CMAKE_COMMAND} -E echo \"void foo() {}\" > ${CMAKE_BINARY_DIR}/generated/foo.c | ||
BYPRODUCTS ${CMAKE_BINARY_DIR}/generated/foo.c | ||
) | ||
target_sources(generated_source_file PRIVATE ${CMAKE_BINARY_DIR}/generated/foo.c) |
6 changes: 6 additions & 0 deletions
6
tests/generated_source_file/app_generated_source_file/src/main.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
void foo(); | ||
|
||
int main() { | ||
foo(); | ||
return 0; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Application uses module lib_mod0, which has a source file that is generated in the build directory before | ||
being compiled and linked. Two configs are created to check that APP_BUILD_TARGETS is correctly used as a | ||
list in lib_mod0's lib_build_info.cmake. |
14 changes: 14 additions & 0 deletions
14
tests/lib_generated_source_file/app_lib_generated_source_file/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
include($ENV{XMOS_CMAKE_PATH}/xcommon.cmake) | ||
project(lib_generated_source_file) | ||
|
||
set(APP_HW_TARGET XCORE-AI-EXPLORER) | ||
|
||
set(APP_COMPILER_FLAGS_cfg0 -Os) | ||
set(APP_COMPILER_FLAGS_cfg1 -O3) | ||
|
||
set(APP_DEPENDENT_MODULES "lib_mod0") | ||
|
||
set(XMOS_SANDBOX_DIR ${CMAKE_CURRENT_LIST_DIR}/..) | ||
|
||
XMOS_REGISTER_APP() |
6 changes: 6 additions & 0 deletions
6
tests/lib_generated_source_file/app_lib_generated_source_file/src/main.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "mod0.h" | ||
|
||
int main() { | ||
mod0(); | ||
return 0; | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#ifndef MOD0_H | ||
#define MOD0_H | ||
void mod0(); | ||
#endif |
15 changes: 15 additions & 0 deletions
15
tests/lib_generated_source_file/lib_mod0/lib_mod0/lib_build_info.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(LIB_NAME lib_mod0) | ||
set(LIB_VERSION 1.0.0) | ||
set(LIB_INCLUDES api) | ||
set(LIB_DEPENDENT_MODULES "") | ||
|
||
XMOS_REGISTER_MODULE() | ||
|
||
add_custom_target(mod0_generated.c | ||
${CMAKE_COMMAND} -E echo \"void mod0_generated() {}\" > ${CMAKE_BINARY_DIR}/mod0_generated.c | ||
BYPRODUCTS ${CMAKE_BINARY_DIR}/mod0_generated.c | ||
) | ||
|
||
foreach(_target ${APP_BUILD_TARGETS}) | ||
target_sources(${_target} PRIVATE ${CMAKE_BINARY_DIR}/mod0_generated.c) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "mod0.h" | ||
|
||
void mod0_generated(); | ||
|
||
void mod0() { | ||
mod0_generated(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters