platform-independent build settings for shared libs?

General questions regarding the usage of CodeLite
amwink
CodeLite Enthusiast
Posts: 27
Joined: Mon Jun 08, 2020 4:04 pm
Genuine User: Yes
IDE Question: c++
Contact:

platform-independent build settings for shared libs?

Post by amwink »

I'm building some shared libraries in Linux, the first versions of which I made in Windows. Their project settings are fairly minimal, I'm using the CodeLite Makefile generator and the Output File was set as lib$(ProjectName).dll.

In Linux the output file should be lib$(ProjectName).so. Would it be possible to make some sort of conditional environment variable $(SharedLibExt) that is set to .dll on Windows and .so on Linux?

I'm not quite sure how libraries like OpenBLAS do this, but I guess it's a function in CMake. In CodeLite, its own makefile generator is ever so slightly easier to work with though, so if it can be done without CMake that would be great.

User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: platform-independent build settings for shared libs?

Post by Jarod42 »

Alternatively, premake allows to generate stand-alone native Codelite workspace (and it supports natively shared library extension).

amwink
CodeLite Enthusiast
Posts: 27
Joined: Mon Jun 08, 2020 4:04 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: platform-independent build settings for shared libs?

Post by amwink »

Interesting! And could I then make a .project file that would work in CodeLite? or would I need to use premake to make the project files work?

User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: platform-independent build settings for shared libs?

Post by Jarod42 »

By stand-alone, I mean that Premake is unneeded once you have generated the workspace (contrary to CMake which is intrusive and do the build).

Post Reply