rules_foreign_cc icon indicating copy to clipboard operation
rules_foreign_cc copied to clipboard

cmake not support $(execpath //foo:bar)?

Open xiedeacc opened this issue 3 years ago • 1 comments

I defined a cache_entries: "MYSQL_INCLUDE_DIR": "$(locations @mysqlclient)" + "/include", but $(locations @mysqlclient) is empty, so it's cmake not support make variables? or just cannot used in cache_entries or way I used not correct?

xiedeacc avatar Feb 10 '23 09:02 xiedeacc

I just had the same problem trying to reference a file in copts. AFAIK the rules need to be updated to support it.

I had to use the ${EXT_BUILD_ROOT} variable to get the correct path.

copts = [
    '-DMY_VAR="${EXT_BUILD_ROOT}/my_path/my_file.h"',
]

This feels quite ugly, and if your project can be imported by others then it won't work because the path will contain external/your_dep_name/....

jagobagascon avatar Feb 23 '23 16:02 jagobagascon