www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - DWT building

reply Alexandr Druzhinin <drug2004 bk.ru> writes:
Hello
How to link application against dwt lib without rdmd? I use monodevelop 
and need to pass arguments to compiler. if I use rdmd like this:
rdmd build swtsnippets[Snippet195]
it cannot find derelict and fail and I cant imagine how to pass argument 
to rdmd. And I'd like to use dmd instead of rdmd build

Thanks
Jan 24 2013
next sibling parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
24.01.2013 22:32, Alexandr Druzhinin пишет:
 Hello
 How to link application against dwt lib without rdmd? I use monodevelop
 and need to pass arguments to compiler. if I use rdmd like this:
 rdmd build swtsnippets[Snippet195]
 it cannot find derelict and fail and I cant imagine how to pass argument
 to rdmd. And I'd like to use dmd instead of rdmd build

 Thanks
I've solved the problem with using -Jpath\to\dwt\org.eclipse.swt.snippets\res\ and linking against every lib from dwt\lib. But I think it isn't clear way - there is nothing about it in readme.
Jan 24 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-01-24 19:00, Alexandr Druzhinin wrote:

 I've solved the problem with using
 -Jpath\to\dwt\org.eclipse.swt.snippets\res\ and linking against every
 lib from dwt\lib. But I think it isn't clear way - there is nothing
 about it in readme.
The -J swtich should be handled automatically, if not, please report an issue: https://github.com/d-widget-toolkit/dwt/issues/new -- /Jacob Carlborg
Jan 24 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
25.01.2013 3:55, Jacob Carlborg пишет:
 On 2013-01-24 19:00, Alexandr Druzhinin wrote:

 I've solved the problem with using
 -Jpath\to\dwt\org.eclipse.swt.snippets\res\ and linking against every
 lib from dwt\lib. But I think it isn't clear way - there is nothing
 about it in readme.
The -J swtich should be handled automatically, if not, please report an issue: https://github.com/d-widget-toolkit/dwt/issues/new
Before report one little qualification - -J switch should be handled automatically without dependence what build system is used? Or only when `rdmd build ...` is used?
Jan 24 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-01-25 07:03, Alexandr Druzhinin wrote:

 Before report one little qualification - -J switch should be handled
 automatically without dependence what build system is used? Or only when
 `rdmd build ...` is used?
Only when "rdmd build" is used. When I think about it, you might needed it even if you have built DWT has a library. -- /Jacob Carlborg
Jan 24 2013
parent Alexandr Druzhinin <drug2004 bk.ru> writes:
25.01.2013 14:15, Jacob Carlborg пишет:
 On 2013-01-25 07:03, Alexandr Druzhinin wrote:

 Before report one little qualification - -J switch should be handled
 automatically without dependence what build system is used? Or only when
 `rdmd build ...` is used?
Only when "rdmd build" is used. When I think about it, you might needed it even if you have built DWT has a library.
Then everything works fine as expected!
Jan 25 2013
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-01-24 16:32, Alexandr Druzhinin wrote:
 Hello
 How to link application against dwt lib without rdmd? I use monodevelop
 and need to pass arguments to compiler. if I use rdmd like this:
 rdmd build swtsnippets[Snippet195]
 it cannot find derelict and fail and I cant imagine how to pass argument
 to rdmd. And I'd like to use dmd instead of rdmd build
To pass a flag to the compiler just pass it before the file when invoking rdmd: $ rdmd -O -release -I/path/to/derelict build swtsnippets[Snippet195] If you using monodevelop can you create a project for DWT and link that to your own project and have monodevelop handle the compilation? When compiling DWT using: $ rdmd build base swt It should create a library you can link with. Then but the "swt" (and possible "base") directory in the import path or pass it to the compiler using -I. It should be just like any other library. -- /Jacob Carlborg
Jan 24 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
25.01.2013 3:58, Jacob Carlborg пишет:
 To pass a flag to the compiler just pass it before the file when
 invoking rdmd:

 $ rdmd -O -release -I/path/to/derelict build swtsnippets[Snippet195]
I did it, but rdmd didn't find libraries and imports in this case and this was the reason of my post. When I wrote imports to sc.ini then imports were found of course but libraries weren't.
 If you using monodevelop can you create a project for DWT and link that
 to your own project and have monodevelop handle the compilation?

 When compiling DWT using:

 $ rdmd build base swt

 It should create a library you can link with. Then but the "swt" (and
 possible "base") directory in the import path or pass it to the compiler
 using -I. It should be just like any other library.
I easily build dwt with rdmd, the problem occurs when I try to compile snippet195 - with opengl that needs additional imports and libs. The other snippets without auxilary dependences build easily and work properly out of box. What is interesting: rdmd build swtsnippets builds snippet195 among others without any error, but on launching executable Windows says it isn't win32 application.
Jan 24 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-01-25 07:00, Alexandr Druzhinin wrote:

 I easily build dwt with rdmd, the problem occurs when I try to compile
 snippet195 - with opengl that needs additional imports and libs. The
 other snippets without auxilary dependences build easily and work
 properly out of box.
 What is interesting:
 rdmd build swtsnippets
 builds snippet195 among others without any error, but on launching
 executable Windows says it isn't win32 application.
Ok, I know what's going on. When running "rdmd -Ifoo build" all flags passed to rdmd is used when compiling "build.d". build.d is compiled into an executable that rdmd runs. This executable then builds the DWT library. The flags passed to rdmd are not passed down to the "build" executable. It's possible to pass flags to the executable via rdmd but they are not currently handled by build.d. Please file an issue. Sorry, I was confusing things. -- /Jacob Carlborg
Jan 24 2013
parent Alexandr Druzhinin <drug2004 bk.ru> writes:
25.01.2013 14:33, Jacob Carlborg пишет:
 Ok, I know what's going on. When running "rdmd -Ifoo build" all flags
 passed to rdmd is used when compiling "build.d". build.d is compiled
 into an executable that rdmd runs. This executable then builds the DWT
 library. The flags passed to rdmd are not passed down to the "build"
 executable.
Yes, it is
 It's possible to pass flags to the executable via rdmd but they are not
 currently handled by build.d. Please file an issue.
Ok
 Sorry, I was confusing things.
No sorry! Thank you for your good job! :)
Jan 25 2013