July 18, 2013
On Thu, Jul 18, 2013 at 10:22:14AM +0200, eles wrote:
> On Thursday, 11 July 2013 at 14:42:09 UTC, H. S. Teoh wrote:
> >On Thu, Jul 11, 2013 at 08:09:33AM +0100, Iain Buclaw wrote:
> >>On Jul 11, 2013 1:28 AM, "H. S. Teoh" <hsteoh@quickfur.ath.cx>
> >You're right, I'll have to rewrite gdmd.compile() to do everything in one go instead of compiling separately, as I have it now.
> 
> This? (BTW, how to send github pull requests to a fork of the main
> repo?)

I think you have to fork my fork in order to make a pull, I don't know if github supports pull requests to a different fork of the main repo.


> diff --git a/gdmd.d b/gdmd.d
> index bb310aa..dd08900 100644
> --- a/gdmd.d
> +++ b/gdmd.d
> @@ -513,7 +513,7 @@ void parseArgs(Config cfg, string[] _args)
>  /**
>   * Compiles the given source files.
>   */
> -void compile(Config cfg)
> +void compile_only(Config cfg)
>  {
>      foreach (srcfile; cfg.sources) {
>          auto objfile = cfg.src2obj(srcfile);
> @@ -590,18 +590,18 @@ unittest
>  }
> 
>  /**
> - * Links the given sources files into the final executable.
> + * Compiles and links the given sources files into the final
> executable.
>   */
> -void link(Config cfg)
> +void compile_and_link(Config cfg)
>  {
> -    /*
> +       /*
>       * Construct link command
>       */
> -    auto cmd = [ cfg.linker ] ~ cfg.linkFlags;
> +    auto cmd = [ cfg.linker ] ~ cfg.gdcFlags ~ cfg.linkFlags;
> 
>      // Collect all object files.
>      foreach (srcfile; cfg.sources) {
> -        cmd ~= cfg.src2obj(srcfile);
> +        cmd ~= srcfile;
>      }
> 
>      // Create target directory if it doesn't exist yet.
> @@ -619,7 +619,7 @@ void link(Config cfg)
>      debug writeln("[exec] ", cmd.join(" "));
>      auto rc = execute(cmd);
>      if (rc.status != 0)
> -        throw new Exception("Link failed: %s".format(rc.output));
> +        throw new Exception("Compile and link failed:
> %s".format(rc.output));
>  }
> 
>  /**
> @@ -636,10 +636,12 @@ int main(string[] args)
>              exit(0);
>          }
> 
> -        compile(cfg);
> -
> -        if (!cfg.dontLink)
> -            link(cfg);
> +       if (cfg.dontLink) {
> +               compile_only(cfg);
> +       }
> +       else {
> +               compile_and_link(cfg);
> +       }
> 
>          return 0;
>      } catch(ExitException e) {

Thanks for the diff! I'll try to find some time today to apply it.


T

-- 
Тише едешь, дальше будешь.
July 19, 2013
On Thursday, 18 July 2013 at 17:10:10 UTC, H. S. Teoh wrote:
> On Thu, Jul 18, 2013 at 10:22:14AM +0200, eles wrote:
>> On Thursday, 11 July 2013 at 14:42:09 UTC, H. S. Teoh wrote:
>> >On Thu, Jul 11, 2013 at 08:09:33AM +0100, Iain Buclaw wrote:
>> >>On Jul 11, 2013 1:28 AM, "H. S. Teoh" <hsteoh@quickfur.ath.cx>
> I think you have to fork my fork in order to make a pull, I don't know
> if github supports pull requests to a different fork of the main repo.

I did try that, but it forks the original repo instead.

I think, in the theory, only Iain could be able to integrate your (and mine) pull requests into his repository.

What about you getting the keys of the main gdmd repo and move there the D-port of gdmd?

You already did tremendous amount of work, to the point that the old version of gdmd (the Perl script) could be already dropped (or kept for historical reasons).