forked from jpoirier/picoc
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
47 lines (42 loc) · 1.2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.15)
project(picoc C)
execute_process(COMMAND git show-ref --abbrev=8 --head --hash head OUTPUT_VARIABLE hash OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git describe --abbrev=0 --tags OUTPUT_VARIABLE tag OUTPUT_STRIP_TRAILING_WHITESPACE)
message("${tag} ${hash}")
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic")
set(CMAKE_REQUIRED_LIBRARIES m readline)
add_definitions(-DUNIX_HOST -DVER="${hash}" -DTAG="${tag}")
#add_definitions(-DDEBUG_EXPRESSIONS)
include_directories(.)
add_executable(picoc
cstdlib/ctype.c
cstdlib/errno.c
cstdlib/math.c
cstdlib/stdbool.c
cstdlib/stdio.c
cstdlib/stdlib.c
cstdlib/string.c
cstdlib/time.c
cstdlib/unistd.c
platform/library_unix.c
platform/platform_unix.c
clibrary.c
debug.c
expression.c
heap.c
include.c
interpreter.h
lex.c
parse.c
picoc.c
picoc.h
platform.c
platform.h
stats.c
stats.h
table.c
type.c
variable.c)
target_link_libraries(picoc -lm -lreadline)