www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DSSS on lib wiht import inside version

reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Hi,
I'm trying to make a dsss.conf for schooner.
Schooner can be built in two different flavors, one flavor using 
derelict for openGL, and another flavor using a built-in static 
translation of the OpenGL headers.  To that end some of the Schooner 
libraries use the following:
---------------
module gld;

version (useDerelict) {
   public import derelict.opengl.gl;
} else {
   public import gl;
}
...
---------------

When dsss tries to compile this library is fails to find gl.d.  I think 
perhaps the version statements are confusing it.

I suspect I could work around it if there were a way to explicitly force 
a depencdency in the dsss.conf, but I don't see such a thing.

Here's my current take at a dsss.conf for schooner:

-----
name = schooner

version(Posix) {
[x11]
buildflags+=-Ix11/source
exclude=x11/buildme.d
} else {
[win32]
buildflags+=-Iwin32/source
exclude=win32/buildme.d win32/source/win32/all.d
}

[freetype]
buildflags+=-Ifreetype/source
exclude=freetype/buildme.d freetype/build_freetype.d

[gl]
buildflags+=-Igl/source
exclude=gl/buildme.d

[gld]
buildflags+=-Igld/source
exclude=gld/buildme.d

[fonts]
buildflags+=-Ifonts/source
exclude=fonts/buildme.d

[*]
version(useDerelict) {
   buildflags+=-version=useDerelict
}
-----
Aug 12 2007
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Bill Baxter wrote:
 Hi,
 I'm trying to make a dsss.conf for schooner.
 Schooner can be built in two different flavors, one flavor using 
 derelict for openGL, and another flavor using a built-in static 
 translation of the OpenGL headers.  To that end some of the Schooner 
 libraries use the following:
 ---------------
 module gld;
 
 version (useDerelict) {
   public import derelict.opengl.gl;
 } else {
   public import gl;
 }
 ...
 ---------------
 
 When dsss tries to compile this library is fails to find gl.d.  I think 
 perhaps the version statements are confusing it.
 
 I suspect I could work around it if there were a way to explicitly force 
 a depencdency in the dsss.conf, but I don't see such a thing.
 
 Here's my current take at a dsss.conf for schooner:
 
 -----
 name = schooner
 
 version(Posix) {
 [x11]
 buildflags+=-Ix11/source
 exclude=x11/buildme.d
 } else {
 [win32]
 buildflags+=-Iwin32/source
 exclude=win32/buildme.d win32/source/win32/all.d
 }
 
 [freetype]
 buildflags+=-Ifreetype/source
 exclude=freetype/buildme.d freetype/build_freetype.d
 
 [gl]
 buildflags+=-Igl/source
 exclude=gl/buildme.d
 
 [gld]
 buildflags+=-Igld/source
 exclude=gld/buildme.d
 
 [fonts]
 buildflags+=-Ifonts/source
 exclude=fonts/buildme.d
 
 [*]
 version(useDerelict) {
   buildflags+=-version=useDerelict
 }
 -----

Here's the actual error I get when trying to build gld: gld\source\gld.d(6): module gl cannot read file 'gl.d' Actually it seems like the problem is that gl.d is originally located in gl/source/gl.d, but it wants to be installed as include/d/gl.d (for use as "import gl;"). All the schooner modules do that sort of thing. All of the lib source is located in a 'source' subdir, but the files need to be installed *without* the subdirectory prefix. --bb
Aug 12 2007