Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-06

switch units depending on OS and lib version

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi!

There is a pascal wrapper for a library.
The library comes in different versions.
The library is specialized per operating system.

How can I make fpc pick the right OS- and release version of the library?

I know I could fiddle something using ifdef's, but since the rtl is build around selection per os and cpu there seems to be a better way (regarding include files?).

TIA,

Marc Santhoff

Reply by email

leledumbo
to Marc Santhoff

You've known the answer, use include files! The compiler information (i.e. target platform) can be obtained via fpc -iXXX (see fpc -h for XXX values). Use that value in a script (i.e. Makefiles) to subtitute directory names. That's what the compiler do all this time.

View this message in context: http://www.nabble.com/switch-units-depending-on-OS-and-lib-version-tp24055826p24066573.html Sent from the Free Pascal - General mailing list .

Reply by email

Marc Santhoff
to leledumbo
leledumbo wrote
You've known the answer, use include files! The compiler information (i.e. target platform) can be obtained via fpc -iXXX (see fpc -h for XXX values). Use that value in a script (i.e. Makefiles) to subtitute directory names. That's what the compiler do all this time.

I see.

So doing that way would lead to move the dependencies out of the pascal source into some form of build script. I'll think about what fits my needs better.

Thank you very much,

Marc Santhoff

Reply by email