Thread overview
Building static and dynamic
Feb 14, 2016
Russel Winder
Feb 14, 2016
ZombineDev
Feb 14, 2016
Russel Winder
February 14, 2016
I am fairly sure I have asked this before, but I can't find the email…

LDC builds for static and dynamic libraries fine, but it requires two independent build/install with a manual edit of a file in between. Is there any way of getting CMake to create a build that build both and installs both without intervention?

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



February 14, 2016
On Sunday, 14 February 2016 at 09:54:37 UTC, Russel Winder wrote:
> I am fairly sure I have asked this before, but I can't find the email…
>
> LDC builds for static and dynamic libraries fine, but it requires two independent build/install with a manual edit of a file in between. Is there any way of getting CMake to create a build that build both and installs both without intervention?

https://github.com/ldc-developers/ldc/issues/1282
February 14, 2016
On Sun, 2016-02-14 at 09:58 +0000, ZombineDev via digitalmars-d-ldc wrote:
> On Sunday, 14 February 2016 at 09:54:37 UTC, Russel Winder wrote:
> > I am fairly sure I have asked this before, but I can't find the email…
> > 
> > LDC builds for static and dynamic libraries fine, but it requires two independent build/install with a manual edit of a file in between. Is there any way of getting CMake to create a build that build both and installs both without intervention?
> 
> https://github.com/ldc-developers/ldc/issues/1282

I have noted this on the issue as well:

In order to generate both static and dynamic libraries, you have to run the build twice. In the CMakeCache.txt file, near the top is an option:

//Whether to build the runtime as a shared library BUILD_SHARED_LIBS:BOOL=ON

Switching this to ON creates dynamic libraries, amending to OFF and rerunning the build creates the static libraries. My question is: Surely CMake can do both as a single batch job? If it cannot then it would have to be seen as a mark that CMake is crap.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder