2

I am using a simple GYP file to build a simple D program. The GYP file follows:

{
  'targets': [
    {
      'target_name': 'bin/launchprogram',
      'type': 'executable',
      'sources': [
        'src/launchprogram.d',
      ],
      'actions': [
        {
          'action_name': 'gdc',
          'inputs': [
            'src/launchprogram.d'
          ],
          'outputs': [
            'bin/launchprogram'
          ],
          'action': [
            'gdc',
            '-o', 'bin/launchprogram',
            '-O3', '-march=native',
            'src/launchprogram.d'
          ],
        },
      ],
    },
  ],
}

The compilation doesn't work -- it tries to run g++ on the produced executable and that of course fails. What did I do wrong?

This is my first attempt at using GYP, so please be patient.

Demi
  • 3,535
  • 5
  • 29
  • 45
  • This is a side note, but are you aware of dub (https://github.com/rejectedsoftware/dub)? This is the de-facto standard package manager and build tool for D projects. I believe it would be a better choice than gyp. – Sergei Nosov Mar 17 '14 at 11:46
  • No I did not. I thought all D build tools where not maintained. Thanks! – Demi Mar 17 '14 at 13:09

1 Answers1

1

It works when I change the executable type to 'none', to keep GYP from trying to link.

Demi
  • 3,535
  • 5
  • 29
  • 45