-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
105 lines (91 loc) · 3.35 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.26)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
cmake_policy(SET CMP0077 NEW)
project(VigurVM
VERSION 0.1
DESCRIPTION "A simple Java Virtual Machine for learning purposes"
LANGUAGES CXX
)
add_executable(${PROJECT_NAME}
src/main.cpp
src/Core.h
src/ByteArray.h
src/ByteArray.cpp
src/Platform.h
src/Util.cpp
src/Util.h
src/Memory.h
src/DynamicArray.cpp
src/DynamicArray.h
src/VM/VM.cpp
src/VM/VM.h
src/VM/Configuration.h
src/VM/JavaHeap.h
src/VM/JavaHeap.cpp
src/VM/VMThread.h
src/VM/JavaStack.h
src/VM/VMThread.cpp
src/VM/Native.h
src/VM/Native.cpp
src/Data/Attribute.h
src/Data/Attribute.cpp
src/Data/Class.h
src/Data/ConstantPool.h
src/Data/ConstantPool.cpp
src/Data/Descriptor.h
src/Data/Variable.h
src/Data/Opcode.h
src/ClassLoader/AttributeParser.h
src/ClassLoader/AttributeParser.cpp
src/ClassLoader/ClassLoader.h
src/ClassLoader/ClassLoader.cpp
src/ClassLoader/DescriptorParser.h
src/ClassLoader/DescriptorParser.cpp
src/VM/Instruction.h
src/VM/Instructions/ConstantInstructions.h
src/VM/Instructions/ConstantInstructions.cpp
src/VM/Instructions/LoadInstructions.h
src/VM/Instructions/LoadInstructions.cpp
src/VM/Instructions/StoreInstructions.h
src/VM/Instructions/StoreInstructions.cpp
src/VM/Instructions/StackInstructions.h
src/VM/Instructions/StackInstructions.cpp
src/VM/Instructions/ReferenceInstructions.h
src/VM/Instructions/ReferenceInstructions.cpp
src/VM/Instructions/ControlInstructions.h
src/VM/Instructions/ControlInstructions.cpp
src/VM/Instructions/ExtendedInstructions.h
src/VM/Instructions/ExtendedInstructions.cpp
src/VM/Instructions/MathInstructions.h
src/VM/Instructions/MathInstructions.cpp
src/VM/Instructions/ComparisonInstructions.h
src/VM/Instructions/ComparisonInstructions.cpp
src/VM/Instructions/ConversionInstructions.h
src/VM/Instructions/ConversionInstructions.cpp
)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} /GR- -EHa- -Gm- -DUNICODE -D_UNICODE -W4")
add_subdirectory(src/Windows)
target_link_directories(${PROJECT_NAME} PRIVATE Windows)
target_link_libraries(${PROJECT_NAME} Windows)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_subdirectory(src/Linux)
target_link_directories(${PROJECT_NAME} PRIVATE Linux)
target_link_libraries(${PROJECT_NAME} Linux)
endif()
target_link_directories(${PROJECT_NAME} INTERFACE Library)
target_link_libraries(${PROJECT_NAME} Library)
enable_testing()
add_subdirectory(extern/md5)
SET(PHYSFS_BUILD_TEST OFF CACHE BOOL "Build stdio test program." FORCE)
SET(PHYSFS_BUILD_SHARED OFF CACHE BOOL "Build shared library" FORCE)
add_subdirectory(extern/physfs)
add_subdirectory(extern/classpath)
add_subdirectory(src/Library)
add_subdirectory(test)
add_subdirectory(tools/ClassDump)
target_link_directories(${PROJECT_NAME} PRIVATE extern/physfs/src)
target_link_libraries(${PROJECT_NAME} physfs-static)