File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -938,3 +938,34 @@ install them into the same virtual environment where :ref:`piocore` is installed
938938
939939 # Install custom packages from the PyPi registry
940940 env.Execute(" $PYTHONEXE -m pip install pkg1 pkg2" )
941+
942+ Build external sources
943+ ^^^^^^^^^^^^^^^^^^^^^^
944+
945+ If your project depends on some arbitrary source files that are located outside of the
946+ usual source directory :ref: `projectconf_pio_src_dir ` then you can use a preliminary
947+ extra script to add them to the build process. A typical situation when this approach
948+ may be useful is when a project depends on pregenerated files in a temporary folder.
949+ Here is a typical configuration with an extra_script that instructs PlatformIO to build
950+ all sources in an external folder:
951+
952+ ``platformio.ini ``:
953+
954+ .. code-block :: ini
955+
956+ [env:my_env]
957+ platform = ...
958+ extra_scripts = pre:extra_script.py
959+
960+ ``extra_script.py `` (place it near ``platformio.ini ``):
961+
962+ .. code-block :: python
963+
964+ import os
965+
966+ Import(" env" )
967+
968+ env.BuildSources(
969+ os.path.join(" $BUILD_DIR" , " external" , " build" ),
970+ os.path.join(" $PROJECT_DIR" , " external" , " sources" )
971+ )
You can’t perform that action at this time.
0 commit comments