-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (54 loc) · 1.55 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
54
55
56
57
58
59
60
cmake_minimum_required(VERSION 3.21)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(roast)
set(PROJECT_FILES
README.md
src/main.c
src/assembly/code_generator.c
src/assembly/code_generator.h
src/assembly/llir.c
src/assembly/llir.h
src/assembly/llir_generator.c
src/assembly/llir_generator.h
src/assembly/ssa.c
src/assembly/ssa.h
src/assembly/symbol_table.c
src/assembly/symbol_table.h
src/optimizations/cf.c
src/optimizations/cf.h
src/optimizations/cp.c
src/optimizations/cp.h
src/optimizations/dce.c
src/optimizations/dce.h
src/optimizations/optimizations.c
src/optimizations/optimizations.h
src/parser/ast.c
src/parser/ast.h
src/parser/parser.c
src/parser/parser.h
src/scanner/scanner.c
src/scanner/scanner.h
src/scanner/token.c
src/scanner/token.h
src/semantics/ir.c
src/semantics/ir.h
src/semantics/semantics.c
src/semantics/semantics.h
src/semantics/symbol_table.c
src/semantics/symbol_table.h)
set(FLAGS
"-Wall"
"-Wextra"
"-Wpedantic"
"-Wno-unused-parameter"
"-Wno-unused-variable"
"-Wno-unused-function"
"-Wno-unused-but-set-variable"
"-std=c11")
add_executable(roast ${PROJECT_FILES})
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${PROJECT_FILES})
find_package(PkgConfig REQUIRED)
pkg_check_modules(DEPENDENCIES REQUIRED IMPORTED_TARGET glib-2.0)
target_link_libraries(roast PkgConfig::DEPENDENCIES)
target_compile_options(roast PRIVATE ${FLAGS})
target_include_directories(roast PRIVATE src/)