batterycenter / embed

A CMake/C++20 library to embed resource files at compile time
Apache License 2.0
116 stars 4 forks source link

Unable to embed the same file to two targets #3

Closed gczuczy closed 6 months ago

gczuczy commented 8 months ago

Hello,

I'm trying to use your awesome stuff, however I also need to attach the same file for my unit tests, and while doing so I'm getting an error:

b_embed(fermd sql/v1.sql)
b_embed(tests_fermd sql/v1.sql)

Error:

CMake Error at _deps/battery-embed-src/CMakeLists.txt:324 (message):
  embed: Identifier already in use: 'sql_v1_sql'
Call Stack (most recent call first):
  fermd/CMakeLists.txt:19 (b_embed)

I think this is a legitimate usecase. How should we be doing this?

HerrNamenlos123 commented 6 months ago

I released a new version where this feature is finally available

HerrNamenlos123 commented 6 months ago

Please check if it works for you

gczuczy commented 6 months ago

Thank you, when I get a bit of time to work on this, I will recheck this.