Path to cmdfile?

Jeremy DeHaan dehaan.jeremiah at gmail.com
Tue Dec 17 08:26:36 PST 2013


On Monday, 16 December 2013 at 08:01:30 UTC, evilrat wrote:
> On Monday, 16 December 2013 at 07:33:47 UTC, Jeremy DeHaan 
> wrote:
>> I've been brain storming lately on some ideas to simplify 
>> building for the library I've been working on, and I wanted to 
>> do some experimenting using cmdfiles. Is there some way that I 
>> can pass a search path for these bad boys to the compiler if 
>> they are just text files?
>
> don't know about that, but there is string mixin search paths - 
> using it with mixins may be possible alternative for what you 
> trying to achieve(assuming you are using handmade D build 
> script).


I'm not exactly talking about building the library(though that
does give me ideas for future experimenting), but making it
easier for users to use it in their own projects. If I could have
pre-made cmdfiles, the user could just send the compiler a
location to where those are, and use them in their projects. I've
already done some experimenting, and so far things have been
successful, but I would really like a way to let the compiler know
where to look for them. If this existed, it would make the build
process quite a lot easier.

I'm extremely new to Linux so I am still trying to work out
some(a ton of) kinks, but here is an example of one of the
cmdfiles I have been toying with.

Name: dsfml-graphics

-I/usr/local/src/
-L-L/usr/local/lib/dsfml
-L-ldsfml-graphics-2
-L-ldsfml-graphics
-L-ljpeg
-L-lGL
-L-lGLU
-L-lfreetype
-L-lGLEW

I have a couple more files that are put together in a similar
fashion with an end result being a command line that looks like
this to build an example program: dmd main.d @dsfml-graphics
@dsfml-window @dsfml-system

Obviously this wouldn't work on every system , but it is a start
and I really like how it has turned out so far.

> and also depending on your needs it may worth look at dub[1,2].
>
> [1] http://code.dlang.org/download
> [2] https://github.com/rejectedsoftware/dub
I've used DUB before and think it is really cool. Not
everyone uses it, though. I'm trying to come up with a system 
that works
well be it DUB, vanilla command line, or IDE.


More information about the Digitalmars-d-learn mailing list