Add experimental cmake support
This commit is contained in:
parent
366b6fd7f5
commit
e30529d629
|
@ -1,9 +1,8 @@
|
||||||
bin/*
|
bin/*
|
||||||
|
lib/*
|
||||||
|
build/*
|
||||||
src/lex.yy.c
|
src/lex.yy.c
|
||||||
src/lex.yy.h
|
src/lex.yy.h
|
||||||
src/y.tab.c
|
|
||||||
src/y.tab.h
|
|
||||||
lib/*
|
|
||||||
.dir-locals.el
|
.dir-locals.el
|
||||||
GPATH
|
GPATH
|
||||||
GRTAGS
|
GRTAGS
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
|
project(picrin)
|
||||||
|
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib)
|
||||||
|
|
||||||
|
# external libraries
|
||||||
|
add_library(xfile SHARED extlib/xfile/xfile.c)
|
||||||
|
|
||||||
|
# build picrin
|
||||||
|
include_directories(include extlib)
|
||||||
|
link_directories(${PROJECT_SOURCE_DIR}/lib)
|
||||||
|
include(src/CMakeLists.txt)
|
||||||
|
include(tools/CMakeLists.txt)
|
|
@ -0,0 +1,10 @@
|
||||||
|
find_package(FLEX REQUIRED)
|
||||||
|
execute_process(COMMAND flex scan.l WORKING_DIRECTORY src)
|
||||||
|
|
||||||
|
add_library(picrin SHARED
|
||||||
|
src/blob.c src/bool.c src/char.c src/codegen.c src/cont.c src/error.c
|
||||||
|
src/file.c src/gc.c src/init.c src/lex.yy.c src/lib.c src/load.c src/macro.c
|
||||||
|
src/number.c src/pair.c src/port.c src/proc.c src/read.c src/state.c
|
||||||
|
src/string.c src/symbol.c src/system.c src/time.c src/var.c src/vector.c
|
||||||
|
src/vm.c src/write.c)
|
||||||
|
target_link_libraries(picrin m xfile)
|
|
@ -0,0 +1,3 @@
|
||||||
|
add_executable(repl tools/main.c)
|
||||||
|
set_target_properties(repl PROPERTIES OUTPUT_NAME picrin)
|
||||||
|
target_link_libraries(repl picrin readline)
|
Loading…
Reference in New Issue