This commit is contained in:
Marek Kraus 2022-09-24 11:58:47 +02:00
parent e9217452e4
commit 9d8738cb85
4 changed files with 36 additions and 3 deletions

View File

@ -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

6
include/blisp_easy.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef _LIBBLISP_EASY_H
#define _LIBBLISP_EASY_H
#endif

1
lib/blisp_easy.c Normal file
View File

@ -0,0 +1 @@
#include <blisp_easy.h>

View File

@ -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)
target_include_directories(blisp PRIVATE
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/vendor/argtable3/src")
target_link_libraries(blisp PRIVATE
libblisp
argtable3)