platformio / platform-native

Native: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/native
Apache License 2.0
21 stars 28 forks source link

Library-only project generates an "empty" compile_commands.json #15

Closed oatberry closed 3 years ago

oatberry commented 3 years ago

What kind of issue is this?

Configuration

PlatformIO Version (platformio --version): 5.1.1

Description of problem

Steps to Reproduce

  1. run $ pio run -t compiledb in a library that doesn't generate binaries

Actual Results

Expected Results

If problems with PlatformIO Build System:

The content of platformio.ini:

[native]
platform = native
test_transport = native
build_flags = -std=c++17
debug_build_flags = -g -DDEBUG
lib_ldf_mode = deep

[env:release]
extends = native
build_type = release

[env:debug]
extends = native
build_type = debug

Additional info

We have tests that we run natively as this library contains no embedded-specific behavior, just business logic. I would think this would enable generation of a useful compile_commands.json that I can feed to clangd...

ivankravets commented 3 years ago

Fixed in https://github.com/platformio/platform-native/commit/5124578abb60f04bdc48d521d9613686c5ef6f03

Please update dev-platform native to the latest version via pio update.

oatberry commented 3 years ago

Thanks!!