anhero / JsonBox

This is a JSON C++ library. It can write and read JSON files with ease and speed.
MIT License
115 stars 60 forks source link

Add fPIC definition for static compiling into shared libraries #41

Closed sfeller closed 7 years ago

sfeller commented 7 years ago

We are developing an API library where we would like to have a single shared library that includes JsonBox functionality as well our custom code. To statically compile in the JsonBox code, we need to add the fPIC definition to the CMakeLists.txt file. Can we add this to the JsonBox main branch as is seems generally useful. Simple adding the following to line 7 of the CMakeLists.txt file should work.

add_definitions(-fPIC)

sfeller commented 7 years ago

This can be resolved by passing the fPIC option in via the command line (or Superbuild if building from another package). Closing since this is not fundamentally a JsonBox issue.