Eclipse CDT, build both static lib and shared lib

buildeclipse-cdtshared-librariesstatic-libraries

How is it possible to make project in Eclipse CDT to target both static library and shared library?

Best Answer

(assuming you initially created a shared library project)

Create a new build configuration for static library (as you do for Debug/Release).

  • Right click on project
  • Build Configuration
  • Manage
  • New (follow instruction, e.g. name: Static)
  • Properties
  • C/C++ Build
  • Select the new configuration under "Configuration"
  • Build Artifact
  • Artifact type: Static Library

Build your configurations (e.g. Release, Debug, Static)

  • Right click on project
  • Build Configuration
  • Build
  • All

Release and Debug config should create your shared library
Static should create your static library