-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cmake
79 lines (65 loc) · 1.57 KB
/
build.cmake
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Build config
set(BUILD_PROJECT_NAME "FluffyVM")
# We're making library
set(BUILD_IS_LIBRARY YES)
set(BUILD_IS_KERNEL NO)
# If we want make libary and
# executable project
set(BUILD_INSTALL_EXECUTABLE YES)
set(BUILD_MAXIMUM_PERFORMANCE NO)
# Sources which common between exe and library
set(BUILD_SOURCES
src/fiber.c
src/vm.c
src/coroutine.c
src/value.c
src/fiber_impl/posix_thread.c
src/fiber_impl/ucontext.c
src/call_state.c
src/opcodes.c
src/bytecode/bytecode.c
src/bytecode/prototype.c
src/interpreter.c
src/bytecode/protobuf_deserializer.c
src/util.c
src/vm_string.c
src/vm_array_primitive.c
deps/buffer/buffer.c
deps/templated-hashmap/hashmap.c
deps/vec/vec.c
)
# Note that exe does not represent Windows'
# exe its just short hand of executable
#
# Note:
# Still creates executable even building library.
# This would contain test codes if project is
# library. The executable directly links to the
# library objects instead through shared library
set(BUILD_EXE_SOURCES
src/specials.c
src/premain.c
src/main.c
)
# Public header to be exported
# If this a library
set(BUILD_PUBLIC_HEADERS
include/FluffyVM/dummy.h
)
set(BUILD_CFLAGS "")
set(BUILD_LDFLAGS "-L/usr/local/lib/")
set(BUILD_PROTOBUF_FILES
src/format/bytecode.proto
)
set(BUILD_INCLUDE_DIRS
./deps/buffer
./deps/vec
./deps/templated-hashmap/
)
# AddPkgConfigLib is in ./buildsystem/CMakeLists.txt
macro(AddDependencies)
# Example
# AddPkgConfigLib(FluffyGC FluffyGC>=1.0.0)
AddPkgConfigLib(FluffyGC FluffyGC>=1.0.0)
link_libraries(-lm -lprotobuf-c)
endmacro()