I have a (Linux native) project that shall compile two binaries in a run. These biniaries will differ in one CPP file only (containing the respective main()
.
Thus I wrote my platformio.ini
like:
[env]
platform = native
build_flags =
-Wextra
-Wall
# ********************* Full decoder/encoder
[env:licenser]
build_src_filter = +<*> -<.git/> -<.svn/> -<minimal_decoder.cpp>
# ********************* Minimal decoder
[env:minimal_decoder]
build_src_filter = +<*> -<.git/> -<.svn/> -<licenser.cpp>
Alas, when running Build, I get the output:
* Executing task: platformio run --environment licenser
Processing licenser (platform: native)
---------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/licenser/src/FBDecode.o
Compiling .pio/build/licenser/src/FBEncode.o
Compiling .pio/build/licenser/src/FBLicense.o
Compiling .pio/build/licenser/src/licenser.o
Linking .pio/build/licenser/program
======================= [SUCCESS] Took 0.77 seconds =======================
Environment Status Duration
------------- -------- ------------
licenser SUCCESS 00:00:00.767
======================= 1 succeeded in 00:00:00.767 =======================
The second environment seems to be ignored.
Worse, if I will comment out the two lines for the licenser
environment, I get:
* Executing task: platformio run --environment licenser
UnknownEnvNamesError: Unknown environment names 'licenser'. Valid names are 'minimal_decoder'
* The terminal process "platformio 'run', '--environment', 'licenser'" terminated with exit code: 1.
Is there a way to achieve what I want with PlatformIO or should I better step out and use good old make
/cmake
?