41 lines
883 B
CMake
41 lines
883 B
CMake
cmake_minimum_required(VERSION 3.11)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
project(
|
|
object-lisp
|
|
VERSION 1.0
|
|
LANGUAGES C)
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
refcount
|
|
GIT_REPOSITORY https://git.zander.im/Zander671/refcount.git
|
|
GIT_TAG 4efdcc97ae3abbbfc3eb974a7880ff59522b379f)
|
|
|
|
FetchContent_MakeAvailable(refcount)
|
|
|
|
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
|
include(CTest)
|
|
endif()
|
|
|
|
add_compile_options(-fsanitize=address,leak,undefined)
|
|
add_link_options(-fsanitize=address,leak,undefined)
|
|
|
|
add_library(
|
|
olisp
|
|
src/object.c
|
|
src/number.c
|
|
src/array.c
|
|
src/string.c
|
|
src/symbol.c
|
|
src/function.c
|
|
src/hashtable.c)
|
|
target_link_libraries(olisp PUBLIC refcount)
|
|
target_include_directories(olisp PUBLIC include/)
|
|
target_compile_options(olisp PRIVATE -Wall -Wpedantic)
|
|
|
|
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
|
|
add_subdirectory(test/)
|
|
endif()
|