cyfdecyf / cmake-object-library

CMake example comparing object library and static library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object library is a very useful feature which is introduced in cmake 2.8.8.

This feature allows us group a bunch of object files and pass them as src to add_library or add_executable.

Benefits:

  • Avoids unnecessary static library creation
  • No need for linking hack for circular static library dependency

Run make VERBOSE=1 to see the actual compile and link commands.

References:

About

CMake example comparing object library and static library.


Languages

Language:CMake 72.2%Language:C++ 21.7%Language:C 6.1%