Hide source code core

Hey guys. Sorry if this has been answered, I haven’t been able to find any information in the docs or a search on this forum. How can I go about not having to show the source code when distributing a platformIO core project?

I should be able to just build it, then remove the src, but I’m not sure what flag to use in the the config file.


You can please your source code into the private library project/lib/my_private_source_code. Then create bare project that includes some file from this project/lib/my_private_source_code. Build project.

Now, you can share .pioenvs/*/*.a library archive with others. They can place it into the project directory and link with project via Redirecting...

build_flags = -I/opt/include -L/opt/lib -lfoo

OK thanks. But it doesn’t allow me to include anything within lib/ from a file within my lib/

EDIT: Nvm, got that figured out.

Now I get this error:

c:/users/kyle/appdata/roaming/spb_data/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: cannot find -lprogram collect2.exe: error: ld returned 1 exit status ***[.pioenvs\esp8285\firmware.elf] Error 1

config file:

platform = espressif8266_stage
board = esp8285
framework = arduino
lib_dir = lib/
lib_ldf_mode = deep
build_flags = build_flags = -I/opt/include -L/opt/lib -lprogram

Here’s my structure:http://prntscr.com/fc6bxs

Where is this program.a library located?