]> gitweb.hhaalo.de Git - discspan.git/commitdiff
add: option to compile static lib
authorBastian Dehn <hhaalo@arcor.de>
Mon, 23 Aug 2021 19:20:24 +0000 (21:20 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 23 Aug 2021 19:20:24 +0000 (21:20 +0200)
libs/spandisc/CMakeLists.txt
libs/spandisc/include/logic.h
libs/spandisc/src/logic.c

index 0fe149427b6cc2a59e171b928f8b2a39d40949d4..642dae3f66eab1c7f0999d64019263964c7a7029 100644 (file)
@@ -5,11 +5,18 @@ set(INSTALL_HEADER /usr/local/include/spandisc)
 
 project(spandisc)
 
+option(BUILD_SHARED_LIBS "build shared libs" ON)
+
 file(GLOB SOURCES src/*.c)
 file(GLOB PUBLIC_HEADER include/*.h)
 include_directories(include)
 
-add_library(spandisc SHARED ${SOURCES})
+if(BUILD_SHARED_LIBS)
+       add_library(spandisc SHARED ${SOURCES})
+else()
+       add_library(spandisc STATIC ${SOURCES})
+endif()
+
 set_target_properties(spandisc PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADER}")
 target_link_libraries(spandisc m)
 
index cf5ca92291a589fef14b07d913303afe74d3ac43..fa83ccbd0b8e37913b80d19f15463bea18b769de 100644 (file)
@@ -8,7 +8,7 @@
  * @param output is the file name
  * @param disc is the disc struct
  */
-void (*status_print)(const char *output, medium_t disc);
+extern void (*status_print)(const char *output, medium_t disc);
 
 /**
  * Split file pathes from input file with split size into seperated
index 4662d3bdc4768d8a8fa0c83bbe0da7920ce27548..44d9adf8fe864bc57b1f4950593e8813f9cfc1b6 100644 (file)
@@ -7,6 +7,8 @@
 #include "splitter.h"
 #include "filehandler.h"
 
+void (*status_print)(const char *output, medium_t disc);
+
 void on_status_print(const char *output, medium_t disc)
 {
        if (status_print != NULL)