forked from pharo-project/pharo-vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugins.cmake
266 lines (212 loc) · 7.05 KB
/
plugins.cmake
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
include(plugins.macros.cmake)
#
# FilePlugin
#
message(STATUS "Adding plugin: FilePlugin")
if(OSX)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/osx
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/unix
)
file(GLOB FilePlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/src/unix/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/unix/sqUnixCharConv.c
${CMAKE_CURRENT_SOURCE_DIR}/src/fileUtils.c
)
elseif(UNIX)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/unix
${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix
)
file(GLOB FilePlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/src/unix/*.c
${CMAKE_CURRENT_SOURCE_DIR}/src/fileUtils.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/unix/sqUnixCharConv.c
)
else()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/include/win
)
file(GLOB FilePlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/FilePlugin/src/win/*.c
${CMAKE_CURRENT_SOURCE_DIR}/src/fileUtilsWin.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/win/sqWin32Directory.c
)
endif()
addLibraryWithRPATH(FilePlugin
${FilePlugin_SOURCES}
${PHARO_CURRENT_GENERATED}/plugins/src/FilePlugin/FilePlugin.c)
if(OSX)
target_link_libraries(FilePlugin PRIVATE "-framework CoreFoundation")
endif()
if(WIN)
target_compile_definitions(FilePlugin PRIVATE "-DWIN32_FILE_SUPPORT")
endif()
#
# FileAttributesPlugin
#
add_vm_plugin(FileAttributesPlugin)
target_link_libraries(FileAttributesPlugin PRIVATE FilePlugin)
#
# UUIDPlugin
#
if(NOT OPENBSD)
message(STATUS "Adding plugin: UUIDPlugin")
file(GLOB UUIDPlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/plugins/UUIDPlugin/common/*.c
)
addLibraryWithRPATH(UUIDPlugin ${UUIDPlugin_SOURCES})
if(WIN)
target_link_libraries(UUIDPlugin PRIVATE "-lole32")
elseif(UNIX AND NOT OSX)
#find_path(LIB_UUID_INCLUDE_DIR uuid.h PATH_SUFFIXES uuid)
find_library(LIB_UUID_LIBRARY uuid)
message(STATUS "Using uuid library:" ${LIB_UUID_LIBRARY})
target_link_libraries(UUIDPlugin PRIVATE ${LIB_UUID_LIBRARY})
endif()
endif()
#
# Socket Plugin
#
if (${FEATURE_NETWORK})
add_vm_plugin(SocketPlugin)
if(WIN)
target_link_libraries(SocketPlugin PRIVATE "-lWs2_32")
endif()
endif()
#
# Surface Plugin
#
add_vm_plugin(SurfacePlugin
${PHARO_CURRENT_GENERATED}/plugins/src/SurfacePlugin/SurfacePlugin.c)
#
# FloatArray Plugin
#
add_vm_plugin(FloatArrayPlugin
${PHARO_CURRENT_GENERATED}/plugins/src/FloatArrayPlugin/FloatArrayPlugin.c)
#
# LargeIntegers Plugin
#
add_vm_plugin(LargeIntegers)
#
# JPEGReaderPlugin
#
add_vm_plugin(JPEGReaderPlugin)
#
# JPEGReadWriter2Plugin
#
add_vm_plugin(JPEGReadWriter2Plugin)
#
# MiscPrimitivePlugin
#
add_vm_plugin(MiscPrimitivePlugin)
#
# BitBltPlugin
#
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/BitBltPlugin/include/common
)
set(BitBltPlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/BitBltPlugin/src/common/BitBltPlugin.c
)
addLibraryWithRPATH(BitBltPlugin ${BitBltPlugin_SOURCES})
#
# B2DPlugin
#
add_vm_plugin(B2DPlugin)
#
# LocalePlugin
#
message(STATUS "Adding plugin: LocalePlugin")
if(OSX)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/include/osx
)
file(GLOB LocalePlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/src/osx/*.c
)
elseif(UNIX)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/include/unix
)
file(GLOB LocalePlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/src/unix/*.c
)
else()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/include/win
)
file(GLOB LocalePlugin_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/LocalePlugin/src/win/*.c
)
endif()
addLibraryWithRPATH(LocalePlugin ${LocalePlugin_SOURCES})
if(OSX)
target_link_libraries(LocalePlugin PRIVATE "-framework CoreFoundation")
endif()
#
# SqueakSSL
#
message(STATUS "Adding plugin: SqueakSSL")
if(OSX)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/include/osx
)
file(GLOB SqueakSSL_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/src/osx/*.c
)
else()
if(WIN)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/include/win
)
file(GLOB SqueakSSL_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/src/win/*.c
)
else()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/include/unix
)
file(GLOB SqueakSSL_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/SqueakSSL/src/unix/*.c
)
endif()
endif()
addLibraryWithRPATH(SqueakSSL ${SqueakSSL_SOURCES})
if(OSX)
target_link_libraries(SqueakSSL PRIVATE "-framework CoreFoundation")
target_link_libraries(SqueakSSL PRIVATE "-framework Security")
elseif(WIN)
target_link_libraries(SqueakSSL PRIVATE Crypt32 Secur32)
else()
find_package(OpenSSL REQUIRED)
target_link_libraries(SqueakSSL PRIVATE OpenSSL::SSL OpenSSL::Crypto)
endif()
#
# DSAPrims
#
add_vm_plugin(DSAPrims)
#
# UnixOSProcessPlugin
#
if(NOT WIN)
add_vm_plugin(UnixOSProcessPlugin)
target_link_libraries(UnixOSProcessPlugin PRIVATE FilePlugin)
endif()