diff --git a/CMakeLists.txt b/CMakeLists.txt index 745e761..944fd50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,29 @@ project(blisp C) set(CMAKE_C_STANDARD 23) -add_subdirectory(tools/blisp) +option(BLISP_BUILD_CLI "Build CLI Tool" OFF) +option(BLISP_DYNAMIC_LIBRARY "Build dynamic library" OFF) + +if(BLISP_DYNAMIC_LIBRARY) + add_library(libblisp SHARED) +else() + add_library(libblisp STATIC) +endif() + +target_sources(libblisp PRIVATE lib/blisp_easy.c) + +target_include_directories(libblisp PRIVATE ${CMAKE_SOURCE_DIR}/include/) + +set_target_properties(libblisp PROPERTIES + PUBLIC_HEADER "include/blisp_easy.h" + VERSION 1.0 + SOVERSION 1 + OUTPUT_NAME "blisp" +) + +if(BLISP_BUILD_CLI) + add_subdirectory(tools/blisp) +endif() #target_sources(blisp PRIVATE diff --git a/include/blisp_easy.h b/include/blisp_easy.h new file mode 100644 index 0000000..f59dad9 --- /dev/null +++ b/include/blisp_easy.h @@ -0,0 +1,6 @@ +#ifndef _LIBBLISP_EASY_H +#define _LIBBLISP_EASY_H + + + +#endif \ No newline at end of file diff --git a/lib/blisp_easy.c b/lib/blisp_easy.c new file mode 100644 index 0000000..09458c6 --- /dev/null +++ b/lib/blisp_easy.c @@ -0,0 +1 @@ +#include \ No newline at end of file diff --git a/tools/blisp/CMakeLists.txt b/tools/blisp/CMakeLists.txt index 2ba202a..027d131 100644 --- a/tools/blisp/CMakeLists.txt +++ b/tools/blisp/CMakeLists.txt @@ -2,5 +2,9 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/vendor/argtable3 ${CMAKE_CURRENT_BINARY_DIR add_executable(blisp src/main.c src/cmd/write.c) -target_include_directories(blisp PRIVATE "${CMAKE_SOURCE_DIR}/vendor/argtable3/src") -target_link_libraries(blisp PRIVATE argtable3) \ No newline at end of file +target_include_directories(blisp PRIVATE + "${CMAKE_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/vendor/argtable3/src") +target_link_libraries(blisp PRIVATE + libblisp + argtable3) \ No newline at end of file