-
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 #121 from danielpieczko/develop
Allow APP_BUILD_TARGETS to be used inside lib_build_info.cmake
- Loading branch information
Showing
10 changed files
with
68 additions
and
13 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 |
---|---|---|
@@ -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