-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
73 lines (56 loc) · 3.71 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
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(vcpu VERSION 1.0)
include(run.cmake)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS}-D _DEBUG -ggdb3 -std=c++2a -O0 -Wall -Wextra\
-Weffc++ -Waggressive-loop-optimizations -Wc++14-compat -Wmissing-declarations\
-Wcast-align -Wcast-qual -Wchar-subscripts -Wconditionally-supported -Wconversion\
-Wctor-dtor-privacy -Wempty-body -Wfloat-equal -Wformat-nonliteral -Wformat-security\
-Wformat-signedness -Wformat=2 -Winline -Wlogical-op -Wnon-virtual-dtor -Wopenmp-simd\
-Woverloaded-virtual -Wpacked -Wpointer-arith -Winit-self -Wredundant-decls -Wshadow\
-Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=2\
-Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types\
-Wsuggest-override -Wswitch-default -Wswitch-enum -Wsync-nand -Wundef -Wunreachable-code\
-Wunused -Wuseless-cast -Wvariadic-macros -Wno-literal-suffix -Wno-missing-field-initializers\
-Wno-narrowing -Wno-old-style-cast -Wno-varargs -Wstack-protector\
-fcheck-new -fsized-deallocation -fstack-clash-protection\
-fstack-protector -fstrict-overflow -flto-odr-type-merging -fno-omit-frame-pointer -fPIE\
-fsanitize=address,alignment,bool,bounds,enum,float-cast-overflow,float-divide-by-zero,integer-divide-by-zero,leak,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,undefined,unreachable,vla-bound,vptr\
-pie -Wlarger-than=8192 -Wstack-usage=8192")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS}-D _DEBUG -ggdb3 -std=c++2a -O0 -Wall -Wextra\
-Weffc++ -Waggressive-loop-optimizations -Wc++14-compat -Wmissing-declarations\
-Wcast-align -Wcast-qual -Wchar-subscripts -Wconditionally-supported -Wconversion\
-Wctor-dtor-privacy -Wempty-body -Wfloat-equal -Wformat-nonliteral -Wformat-security\
-Wformat-signedness -Wformat=2 -Winline -Wlogical-op -Wnon-virtual-dtor -Wopenmp-simd\
-Woverloaded-virtual -Wpacked -Wpointer-arith -Winit-self -Wredundant-decls -Wshadow\
-Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=2\
-Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types\
-Wsuggest-override -Wswitch-default -Wswitch-enum -Wsync-nand -Wundef -Wunreachable-code\
-Wunused -Wuseless-cast -Wvariadic-macros -Wno-literal-suffix -Wno-missing-field-initializers\
-Wno-narrowing -Wno-old-style-cast -Wno-varargs -Wstack-protector\
-fcheck-new -fsized-deallocation -fstack-clash-protection\
-fstack-protector -fstrict-overflow -flto-odr-type-merging -fno-omit-frame-pointer -fPIE\
-fsanitize=address,alignment,bool,bounds,enum,float-cast-overflow,float-divide-by-zero,integer-divide-by-zero,leak,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,undefined,unreachable,vla-bound,vptr\
-pie -Wlarger-than=8192 -Wstack-usage=8192")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS}-D NLOGS -std=c++2a -Ofast -Wall")
set(CMAKE_LINKER_FLAGS_RELEASE "${CMAKE_CXX_FLAGS}-D NLOGS -std=c++2a -Ofast -Wall")
add_subdirectory(lib/logger)
add_subdirectory(lib/argparser)
add_subdirectory(lib/asm)
add_subdirectory(lib/stack)
add_subdirectory(lib/text_lines)
add_subdirectory(src/asm)
add_subdirectory(src/disasm)
add_subdirectory(src/virtual_machine)
install(TARGETS mbasm mbdisasm mbvm
CONFIGURATIONS Release
RUNTIME)
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()