nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nel] NeL win32 DLL support


From: Vincent Caron
Subject: [Nel] NeL win32 DLL support
Date: Fri, 23 Aug 2002 18:53:27 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530

Hello,

I'm currently building the batch of tools from NeL, I'm getting pretty impressive binary sizes (even in release mode), and fearing a maintenance hardware. Building 3d, misc, net & co as DLL would help me a lot :

- for distribution : I would like to provide a full NeL binary SDK for Windows users (kind of Loic's task, but for Windows), and building all components as DLL makes a _huge_ difference in byte size. I don't have an unlimited bandwidth, so users do in most cases...

- for maintenance : if I update the 3d library code, I spend an incredible amount of time 'only' relinking all tools and dependent libs, since all is currently statically linked. I only build some tools, but my extrapolations lead me to something close to 10min for the whole batch on my Athlon 1800+.

Building as DLL from the current build setup is easy : I just add a 'Custom Build Setup' where I invoke the command line linker to get the DLL from the static lib. Example for misc, DebugFast, VC7:

LINK /DLL /MACHINE:X86 /IMPLIB:../lib7/nlmisc_df_dll.lib /OUT:../lib7/nlmisc_df.dll ../lib7/nlmisc_df.lib msvcrtd.lib libc.lib

As output, you get :

  nlmisc_df.dll       Dynamic NeL misc library
  nlmisc_df_dll.lib   Import library for nmisc_df.dll
  nlmisc_df.lib       Static NeL misc library

Now the problem is to export NeL symbols to the DLL. Two solutions :

a- Listing class names, globals and standalone functions in a per library .def file

b- Adding an export macro in front of every class declaration, global or standalone function, with a value of __declspec(dllexport)

The a solution is tedious and needs painful sync, but is 'non intrusive'. The b solution is the most commonly used, since it simplifies maintenance.

There are some decisions which are yours :

- are you basically okay with the DLL postbuild rule ? Should it be configurable and how ?

- would you support the a or b symbol export method ? (I highly suggest b)

- would you be okay to link all tools with the DLLs as a default in the current VC7 projects ? (Given than nel3d/release is currently 36MB, and that it links against about 30 EXEs, I'm begging you to consider this :)) The only user constraint is to add 'code/nel/lib7' to its PATH, which is pretty easy when you're done with all the tedious 3rd library setup.

I guess you'll have the WE to scratch your head over this :)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]