forked from Kingcom/armips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
166 lines (147 loc) · 3.8 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
cmake_minimum_required(VERSION 2.8)
project(armips)
option(ARMIPS_REGEXP "Enable regexp expression functions" ON)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang")
if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku" OR WIIU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-uninitialized")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11 -Wall -Wno-uninitialized -Wno-unused-parameter")
endif()
endif()
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
elseif(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()
if(ARMIPS_REGEXP)
add_definitions(-DARMIPS_REGEXP=1)
endif()
include_directories(.)
add_library(armips STATIC
Archs/Architecture.h
Archs/Architecture.cpp
Archs/ARM/Arm.cpp
Archs/ARM/Arm.h
Archs/ARM/ArmExpressionFunctions.cpp
Archs/ARM/ArmExpressionFunctions.h
Archs/ARM/ArmElfRelocator.cpp
Archs/ARM/ArmElfRelocator.h
Archs/ARM/ArmOpcodes.cpp
Archs/ARM/ArmOpcodes.h
Archs/ARM/ArmParser.cpp
Archs/ARM/ArmParser.h
Archs/ARM/CArmInstruction.cpp
Archs/ARM/CArmInstruction.h
Archs/ARM/CThumbInstruction.cpp
Archs/ARM/CThumbInstruction.h
Archs/ARM/Pool.cpp
Archs/ARM/Pool.h
Archs/ARM/ThumbOpcodes.cpp
Archs/ARM/ThumbOpcodes.h
Archs/MIPS/CMipsInstruction.cpp
Archs/MIPS/CMipsInstruction.h
Archs/MIPS/Mips.cpp
Archs/MIPS/Mips.h
Archs/MIPS/MipsElfFile.cpp
Archs/MIPS/MipsElfFile.h
Archs/MIPS/MipsExpressionFunctions.cpp
Archs/MIPS/MipsExpressionFunctions.h
Archs/MIPS/MipsElfRelocator.cpp
Archs/MIPS/MipsElfRelocator.h
Archs/MIPS/MipsMacros.cpp
Archs/MIPS/MipsMacros.h
Archs/MIPS/MipsOpcodes.cpp
Archs/MIPS/MipsOpcodes.h
Archs/MIPS/MipsParser.cpp
Archs/MIPS/MipsParser.h
Archs/MIPS/PsxRelocator.cpp
Archs/MIPS/PsxRelocator.h
Commands/CAssemblerCommand.cpp
Commands/CAssemblerCommand.h
Commands/CAssemblerLabel.cpp
Commands/CAssemblerLabel.h
Commands/CDirectiveArea.cpp
Commands/CDirectiveArea.h
Commands/CDirectiveConditional.cpp
Commands/CDirectiveConditional.h
Commands/CDirectiveData.cpp
Commands/CDirectiveData.h
Commands/CDirectiveFile.cpp
Commands/CDirectiveFile.h
Commands/CDirectiveMessage.cpp
Commands/CDirectiveMessage.h
Commands/CommandSequence.cpp
Commands/CommandSequence.h
Core/ELF/ElfTypes.h
Core/ELF/ElfRelocator.cpp
Core/ELF/ElfRelocator.h
Core/ELF/ElfFile.cpp
Core/ELF/ElfFile.h
Core/Assembler.cpp
Core/Assembler.h
Core/Common.cpp
Core/Common.h
Core/Expression.cpp
Core/Expression.h
Core/ExpressionFunctions.cpp
Core/ExpressionFunctions.h
Core/FileManager.cpp
Core/FileManager.h
Core/Misc.cpp
Core/Misc.h
Core/SymbolData.cpp
Core/SymbolData.h
Core/SymbolTable.cpp
Core/SymbolTable.h
ext/tinyformat/tinyformat.h
Parser/DirectivesParser.cpp
Parser/DirectivesParser.h
Parser/ExpressionParser.cpp
Parser/ExpressionParser.h
Parser/Parser.cpp
Parser/Parser.h
Parser/Tokenizer.cpp
Parser/Tokenizer.h
Util/ByteArray.cpp
Util/ByteArray.h
Util/CRC.cpp
Util/CRC.h
Util/EncodingTable.cpp
Util/EncodingTable.h
Util/FileClasses.cpp
Util/FileClasses.h
Util/Util.cpp
Util/Util.h
)
add_executable(armips-bin
Main/CommandLineInterface.cpp
Main/CommandLineInterface.h
Main/main.cpp
Main/Tests.cpp
Main/Tests.h
stdafx.cpp
stdafx.h
)
# workaround library and executable having same name
set_target_properties(armips-bin PROPERTIES OUTPUT_NAME armips)
add_executable(armipstests
Main/CommandLineInterface.cpp
Main/CommandLineInterface.h
Main/main.cpp
Main/Tests.cpp
Main/Tests.h
stdafx.cpp
stdafx.h
)
target_compile_definitions(armipstests PUBLIC ARMIPS_TESTS)
target_link_libraries(armips-bin armips)
target_link_libraries(armipstests armips)
if(WIN32)
target_link_libraries(armips-bin shlwapi)
target_link_libraries(armipstests shlwapi)
endif(WIN32)
if(MINGW)
target_link_libraries(armips-bin -lstdc++)
target_link_libraries(armipstests -lstdc++)
endif(MINGW)