]> git.bts.cx Git - sun.git/blob - runtime/CMakeLists.txt
Groundwork for arrays
[sun.git] / runtime / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.10)
2
3 find_package(BISON)
4 find_package(FLEX)
5
6 project(sun C)
7
8 BISON_TARGET(SunParser ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/sun.y ${CMAKE_CURRENT_BINARY_DIR}/sun_parser.c COMPILE_FLAGS -v)
9 FLEX_TARGET(SunScanner ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/sun.l ${CMAKE_CURRENT_BINARY_DIR}/sun_lexer.c COMPILE_FLAGS --header-file=${CMAKE_CURRENT_BINARY_DIR}/sun_lexer.h)
10 ADD_FLEX_BISON_DEPENDENCY(SunScanner SunParser)
11
12 set(SUN_SOURCES
13 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/compiler.h
14 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/compiler_internal.h
15 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/compiler.c
16 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/vm_generator.h
17 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/compiler/vm_generator.c
18
19 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/crc32.h
20 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/data_type.h
21 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/data_type.c
22 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/node.h
23 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/node.c
24 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/node_type.h
25 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/node_type.c
26 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/operator_type.h
27 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/operator_type.c
28 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/tree.h
29 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/tree/tree.c
30
31 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/vm/fixed.h
32 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/vm/fixed.c
33 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/vm/instruction.h
34 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/vm/instruction.c
35 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/vm/vm.h
36 ${CMAKE_CURRENT_SOURCE_DIR}/src/sun/vm/vm.c
37
38 ${BISON_SunParser_OUTPUTS}
39 ${FLEX_SunScanner_OUTPUTS}
40 )
41
42 add_library(sun ${SUN_SOURCES})
43
44 #add_executable(suncc ${SUNCC_SOURCES})
45 target_include_directories(sun PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) # So the Flex/Bison code can find header
46 target_include_directories(sun PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # So our code can find Flex/Bison code
47 #target_link_libraries(sun suncore)
48 #target_link_libraries(suncc ${FLEX_LIBRARIES})