Selaa lähdekoodia

build: add ability to generate shared library

This patch updates the source tree to generate shared library.

Signed-off-by: Keith Holman <keith.holman@windriver.com>
Keith Holman 7 vuotta sitten
vanhempi
commit
00f3e706f6
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6 2
      src/CMakeLists.txt

+ 6 - 2
src/CMakeLists.txt

@@ -1,5 +1,9 @@
 # The C API library
-add_library(civetweb-c-library civetweb.c)
+set( LIB_TYPE "STATIC" )
+if (BUILD_SHARED_LIBS)
+  set( LIB_TYPE "SHARED" )
+endif()
+add_library(civetweb-c-library ${LIB_TYPE} civetweb.c)
 set_target_properties(civetweb-c-library PROPERTIES
   OUTPUT_NAME "civetweb"
   VERSION ${CIVETWEB_VERSION}
@@ -285,7 +289,7 @@ endif()
 
 # The C++ API library
 if (CIVETWEB_ENABLE_CXX)
-  add_library(civetweb-cpp CivetServer.cpp)
+  add_library(civetweb-cpp ${LIB_TYPE} CivetServer.cpp)
   set_target_properties(civetweb-cpp PROPERTIES
     OUTPUT_NAME "civetweb-cpp"
     VERSION ${CIVETWEB_VERSION}