sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Sometimes relative paths in GYP ldflags section is "off by one"

Open sgjesse opened this issue 10 years ago • 2 comments

In platforms/stm/disco_fletch.gyp we have the following comment:

'ldflags': [
  '-specs=nosys.specs',
  '-specs=nano.specs',
  # TODO(340): Why does this not work???
  #'-T<(generated_path)/SW4STM32/configuration/STM32F746NGHx_FLASH.ld',
  # TODO(340): Why is this needed???
  '-T../../platforms/stm/disco_fletch/generated/SW4STM32/'
    'configuration/STM32F746NGHx_FLASH.ld'
],

The variable generated_path is ../../platforms/stm/disco_fletch/generated/, and works in other rules, but in ldflags an additional .. is added to the generated project.

sgjesse avatar Nov 30 '15 07:11 sgjesse

You have to put a relative file name in a variable named something ending with "_dir" or "_file". See Pathname Relativization.

peter-ahe-google avatar Nov 30 '15 11:11 peter-ahe-google

I cannot get pathname relativization to work for ldflags.

Asked on gyp-developer: https://groups.google.com/forum/#!topic/gyp-developer/W_yZcIsFXEc.

sgjesse avatar Dec 11 '15 08:12 sgjesse