generated from dezashibi-c/cmake_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (46 loc) · 1.78 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
48
49
50
51
52
53
###############################################################################
# GENERAL CONFIGURATIONS AND UTILITIES
###############################################################################
cmake_minimum_required(VERSION 3.20)
set(CMAKE_C_STANDARD 11)
include(cmake/utils.cmake)
###############################################################################
# PROJECT SETUP
###############################################################################
project(CLoxCompiler LANGUAGES C)
include_directories(include src extern)
include(cmake/configs.cmake)
add_subdirectory(tests)
###############################################################################
# EXECUTABLE TARGETS
###############################################################################
add_executable(clox
src/main.c
src/chunk.c
src/memory.c
src/debug.c
src/value.c
src/vm.c
src/compiler.c
src/scanner.c
src/object.c
src/table.c
)
define_macro_option(clox NAN_BOXING ON)
define_macro_option(clox DEBUG_PRINT_CODE OFF)
define_macro_option(clox DEBUG_TRACE_EXECUTION OFF)
define_macro_option(clox DEBUG_STRESS_GC ON)
define_macro_option(clox DEBUG_LOG_GC OFF)
###############################################################################
# PRE BUILD TESTS
###############################################################################
# enable_pre_build_testing(main_exe_file all_tests)
###############################################################################
# POST BUILD FILE COPIES
###############################################################################
set(FILES_TO_COPY
"${CMAKE_SOURCE_DIR}/example/benchmark.lox"
"${CMAKE_SOURCE_DIR}/example/class.lox"
"${CMAKE_SOURCE_DIR}/example/list.lox"
)
define_post_built_copy(clox "examples" ${FILES_TO_COPY})