Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Conversation

@davidhyman
Copy link

Adds a '-x', '--export' option to Yotta
Salient points:

  • find/replace: top level module directories are renamed on export, I've given them a variable and called them 'vendor_*' when exporting
  • find/replace: yotta module build directory likewise (ym -> modules)
  • export copies & renames cached module source directories if possible
  • find/replace: to allow the export to work, now use relative paths throughout
  • also used explicit iteration in the templates where possible, rather than a mix. allows common use of filter function (self.relative)
  • need to template the yotta header file as file path needs setting at CMake run time

thegecko and others added 30 commits August 21, 2017 19:38
1. use common variable for module & target caches
2. change cache directories if exporting
3. export entire built directory to destination
4. missing relative 'include_directories' fixed
e.g. simplelog
wayyyy too much copypaste
there are zero references to the project directory
worth trying on ci
[1/3] Building C object ym/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o
FAILED: /usr/bin/cc -I/path/to/helloyotta -I/path/to/helloyotta/yotta_modules/simplelog -I/path/to/helloyotta/yotta_modules/simplelog/source -O2 -g -DNDEBUG -include "/path/to/helloyotta/build/x86-osx-native/yotta_config.h" -MMD -MT ym/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o -MF ym/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o.d -o ym/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o -c /path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c
[1/3] Building C object modules/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o
FAILED: /usr/bin/cc -I/path/to/helloyotta -I/path/to/helloyotta/yotta_modules/simplelog -I/path/to/helloyotta/yotta_modules/simplelog/source -O2 -g -DNDEBUG -include "/path/to/helloyotta/build/x86-osx-native/yotta_config.h" -MMD -MT modules/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o -MF modules/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o.d -o modules/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o -c /path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should still say ym not modules


```
[1/3] Building C object ym/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o
[1/3] Building C object modules/simplelog/source/CMakeFiles/simplelog.dir/path/to/helloyotta/yotta_modules/simplelog/source/simplelog.c.o
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ym

by a dependency name (if there were no `ym/` at the start of the path then the
by a dependency name (if there were no `modules/` at the start of the path then the
object would belong to the top-level module/app being built). So from
`/ym/simplelog/...` we can tell that the failed file is in the `simplelog`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ym

yotta/build.py Outdated
parser.add_argument('-x', '--export', dest='export',
default=False, const=True, nargs='?',
help=(
'Export mode. If flag is set, generates builds without reference to Yotta.'
Copy link
Member

@thegecko thegecko Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yotta not Yotta, or perhaps remove this comment? e.g. Export mode. If flag is set, generates a buildable folder structure in the specified folder.

submod = False
module = toplevel_module
# <topdir> /ym/<submod>/ym/<submod2>/somedir/somedir --> submod2
# <topdir> /modules/<submod>/modules/<submod2>/somedir/somedir --> submod2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ym ??

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants