forked from OpenSmalltalk/opensmalltalk-vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
574 lines (497 loc) · 15.7 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
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# OpenSmalltalkVM cmake build script.
cmake_minimum_required(VERSION 2.8)
project(OpenSmalltalkVM)
option(ONLY_CONFIG_H "Only generate config.h" OFF)
option(SPUR_OBJECT_MODEL "Spur Object Model" ON)
option(SISTA_OPTIMIZER "Sista Optimizer" OFF)
option(LOWCODE_EXTENSIONS "Lowcode Extensions" OFF)
option(PHARO_BRANDING "Pharo Branding" ON)
option(SUPPORT_TRADITIONAL_DISPLAY "Enables building a VM with support for a window." ON)
option(COG_JIT "Cog JIT" ON)
# Check the build type
if (CMAKE_BUILD_TYPE STREQUAL "")
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
# differentiation between debug and release builds.
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
# Turn on warnings
if (MSVC)
# using Visual Studio C++
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /W3")
set(VM_MSVC TRUE)
else()
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
if(UNIX)
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
# Export symbols from applications.
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-dynamic")
endif()
# Set optimization flags
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo Assert)
if (MSVC)
else()
set(COMMON_FLAGS "")
if(WIN32)
set(COMMON_FLAGS "-falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -Dsetjmp=_setjmp"
)
endif()
set(OPTIMIZATION_FLAGS "-O3 -fno-omit-frame-pointer -finline-functions ${COMMON_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-g ${COMMON_FLAGS} -DDEBUGVM=1")
set(CMAKE_CXX_FLAGS_DEBUG "-g ${COMMON_FLAGS} -DDEBUGVM=1")
set(CMAKE_C_FLAGS_RELEASE "${OPTIMIZATION_FLAGS} -DNDEBUG -DDEBUGVM=0")
set(CMAKE_CXX_FLAGS_RELEASE "${OPTIMIZATION_FLAGS} -DNDEBUG -DDEBUGVM=0")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g ${OPTIMIZATION_FLAGS} -DNDEBUG -DDEBUGVM=0")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g ${OPTIMIZATION_FLAGS} -DNDEBUG -DDEBUGVM=0")
set(CMAKE_C_FLAGS_ASSERT "${OPTIMIZATION_FLAGS} -DDEBUGVM=1")
set(CMAKE_CXX_FLAGS_ASSERT "${OPTIMIZATION_FLAGS} -DDEBUGVM=1")
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(NOT VM_MSVC)
set(VM_DEPENDENCIES_LIBRARIES m ${VM_DEPENDENCIES_LIBRARIES})
endif()
# Add a build x86_32 version on x86_64 systems.
set(IS_64_BITS_BUILD_MACHINE False)
set(IS_X86_ARCH_MACHINE False)
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
set(IS_64_BITS_BUILD_MACHINE True)
# Do not build a 64 bit when invoking cmake with a 32 bits visual studio generator.
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
if(NOT CMAKE_CL_64)
set(IS_64_BITS_BUILD_MACHINE False)
endif()
endif()
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i.86")
set(IS_X86_BUILD_MACHINE True)
endif()
if(IS_64_BITS_BUILD_MACHINE)
option(BUILD_I386_VERSION "Build x86 32 bits version" OFF)
set(SQUEAK_PLATFORM_X86_64 True)
else(IS_X86_BUILD_MACHINE)
set(SQUEAK_PLATFORM_X86_32 True)
endif()
if(SQUEAK_PLATFORM_X86_64)
if(BUILD_I386_VERSION)
set(SQUEAK_PLATFORM_X86_32 True)
set(SQUEAK_PLATFORM_X86_64 False)
else()
set(VM_64BITS TRUE)
set(SourceFolderName "${SourceFolderName}64")
if(WIN32)
set(FFI_VARIANT_X64_WIN64 True)
else()
set(FFI_VARIANT_X64_SYSV True)
endif()
set(VM_TARGET_CPU "x86_64")
endif()
else()
set(VM_64BITS False)
endif()
if(SQUEAK_PLATFORM_X86_32)
if (MSVC)
set(CMAKE_CXX_FLAGS "/arch:SSE2")
set(CMAKE_C_FLAGS "/arch:SSE2")
else()
set(CMAKE_ASM-ATT_FLAGS "--32")
set(CMAKE_CXX_FLAGS "-m32 -msse2")
set(CMAKE_C_FLAGS "-m32 -msse2")
endif()
set(FFI_VARIANT_IA32 True)
set(VM_TARGET_CPU "i686")
endif()
set(VM_TARGET "${CMAKE_SYSTEM}")
if(WIN32)
set(OS_TYPE "Win32")
set(VM_TARGET_OS "Win32")
elseif(UNIX)
set(OS_TYPE "unix")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(OS_TYPE "Mac OS")
set(VM_TARGET_OS "1000") # Used to recognise OS X
set(DARWIN True)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(VM_TARGET_OS "linux-gnu")
else()
set(VM_TARGET_OS "${CMAKE_SYSTEM_NAME}")
endif()
endif()
set(SourceFolderName "")
# Spur object model
if(SPUR_OBJECT_MODEL)
#add_definitions(SpurVM=1)
set(SourceFolderName "spur")
endif()
# Sista optimizer
if(SISTA_OPTIMIZER)
#add_definitions(SistaVM=1)
set(SourceFolderName "${SourceFolderName}sista")
endif()
# Lowcode extended instructions
if(LOWCODE_EXTENSIONS)
add_definitions(-DLowcodeVM=1)
set(SourceFolderName "${SourceFolderName}lowcode")
endif()
# Stack interpreter
if(NOT COG_JIT)
message("COG_JIT ${COG_JIT}")
set(SourceFolderName "${SourceFolderName}stack")
endif()
# 64 bits VM
if(VM_64BITS)
set(SourceFolderName "${SourceFolderName}64")
endif()
# VM branding
set(VM_EXECUTABLE_NAME squeak)
set(VM_LIBRARY_NAME SqueakVMCore)
set(VM_NAME Squeak)
set(PHARO_VM FALSE)
set(SQUEAK_VM FALSE)
if(PHARO_BRANDING)
add_definitions(-DPharoVM=1 -DIMMUTABILITY=1)
set(VM_EXECUTABLE_NAME pharo)
set(VM_LIBRARY_NAME PharoVMCore)
set(VM_NAME Pharo)
set(PHARO_VM TRUE)
else()
set(SQUEAK_VM TRUE)
endif()
add_definitions(-DVM_NAME="${VM_NAME}")
# Set output dir.
# OpenSmalltalkVM_BUILD_AS_INTERNAL_PROJECT can be used before including this
# project using add_subdirectory()
if(NOT OpenSmalltalkVM_BUILD_AS_INTERNAL_PROJECT)
set(EXECUTABLE_OUTPUT_PATH "${OpenSmalltalkVM_BINARY_DIR}/dist")
set(LIBRARY_OUTPUT_PATH "${OpenSmalltalkVM_BINARY_DIR}/dist")
endif()
# Cog JIT
if(COG_JIT)
#add_definitions(CogVM=1)
endif()
set(SourceFolderName "${SourceFolderName}src")
set(PluginsSourceFolderName "src/plugins")
message("Source folder name: ${SourceFolderName}")
# Common defines
add_definitions(-DUSE_GLOBAL_STRUCT=0
-DNO_ISNAN=1
-DUSE_INLINE_MEMORY_ACCESSORS
)
# Configuration
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckLibraryExists)
include(CheckTypeSize)
include(CheckCSourceCompiles)
if(NOT WIN32)
include (TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
else()
set(WORDS_BIGENDIAN False)
endif()
if(WORDS_BIGENDIAN)
add_definitions(-DLSB_FIRST)
endif()
set(HAVE_INTERP_H 1)
check_include_files (alloca.h HAVE_ALLOCA_H)
if(HAVE_ALLOCA_H)
check_c_source_compiles("
#include <alloca.h>
int main()
{
return (int*)alloca(5);
}
" HAVE_ALLOCA)
else()
check_c_source_compiles("
int main()
{
return (int*)alloca(5);
}
" HAVE_ALLOCA)
endif()
check_include_files(dirent.h HAVE_DIRENT_H)
check_include_files(features.h HAVE_FEATURES_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(ndir.h HAVE_NDIR_H)
check_include_files(sys/ndir.h HAVE_SYS_NDIR_H)
check_include_files(sys/dir.h HAVE_SYS_DIR_H)
check_include_files(sys/filio.h HAVE_SYS_FILIO_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_library_exists(dl dlopen "" HAVE_LIBDL)
check_library_exists(dyld dlopen "" HAVE_DYLD)
# check_include_files(iconv.h HAVE_ICONV_H)
# check_library_exists(iconv iconv "" HAVE_ICONV)
# check_library_exists(ffi ffi_call "" HAVE_LIBFFI)
# System calls
check_function_exists(atexit AT_EXIT)
check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(__snprintf HAVE___SNPRINTF)
check_function_exists(nanosleep HAVE_NANOSLEEP)
check_function_exists(mmap HAVE_MMAP)
check_function_exists(kqueue HAVE_KQUEUE)
check_function_exists(select HAVE_SELECT)
check_function_exists(epoll_create1 HAVE_EPOLL)
check_function_exists(epoll_pwait HAVE_EPOLL_PWAIT)
# Time structures
set(CMAKE_EXTRA_INCLUDE_FILES time.h)
if(HAVE_SYS_TIME_H)
set(CMAKE_EXTRA_INCLUDE_FILES sys/time.h ${CMAKE_EXTRA_INCLUDE_FILES})
endif()
check_c_source_compiles(
"#include <time.h>
int main()
{
struct tm *tm = 0;
return (int)tm->tm_gmtoff;
}
"
HAVE_TM_GMTOFF
)
check_type_size("struct timezone" HAVE_TIMEZONE)
set(CMAKE_EXTRA_INCLUDE_FILES)
# Type sizes
if(BUILD_I386_VERSION OR SQUEAK_PLATFORM_X86_32)
set(SIZEOF_INT 4)
set(SIZEOF_LONG 4)
set(SIZEOF_LONG_LONG 8)
set(SIZEOF_VOID_P 4)
else()
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("void*" SIZEOF_VOID_P)
endif()
if("${SIZEOF_LONG}" STREQUAL "8")
set(SQUEAK_INT64_TYPEDEF "long")
elseif("${SIZEOF_LONG_LONG}" STREQUAL "8")
set(SQUEAK_INT64_TYPEDEF "long long")
else()
message(FATAL_ERROR "Failed to find a 64 bits integer type.")
endif()
if(HAVE_LIBDL)
set(VM_DEPENDENCIES_LIBRARIES dl ${VM_DEPENDENCIES_LIBRARIES})
endif()
if(HAVE_DYLD)
set(VM_DEPENDENCIES_LIBRARIES dyld ${VM_DEPENDENCIES_LIBRARIES})
endif()
if(HAVE_ICONV)
set(VM_DEPENDENCIES_LIBRARIES iconv ${VM_DEPENDENCIES_LIBRARIES})
endif()
# Add the current directory.
include_directories(
.
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/platforms/Cross/vm"
"${PROJECT_SOURCE_DIR}/platforms/Cross/plugins"
"${SourceFolderName}/vm"
)
# VM Flavor sources
if(COG_JIT)
set(InterpreterSource ${SourceFolderName}/vm/cointerp.c)
set(VM_FAVLOR_SOURCES
${SourceFolderName}/vm/cogit.c
${InterpreterSource}
)
else()
set(InterpreterSource ${SourceFolderName}/vm/interp.c)
set(VM_FAVLOR_SOURCES
${InterpreterSource}
)
endif()
# Compile the interpreter with less aggresive optimization options.
if(NOT ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") AND NOT MSVC)
set_source_files_properties(${InterpreterSource} PROPERTIES COMPILE_FLAGS -O1)
endif()
# Find required Apple frameworks
if(APPLE)
find_library(CoreFoundation_LIBRARY CoreFoundation)
find_library(CoreServices_LIBRARY CoreServices)
set(VM_DEPENDENCIES_LIBRARIES
${CoreServices_LIBRARY}
${CoreFoundation_LIBRARY}
${VM_DEPENDENCIES_LIBRARIES})
# SDL2 and openssl need this
include_directories(/opt/local/include)
endif()
# Find SDL2
find_path(SDL2_INCLUDE_DIR
NAMES SDL.h
PATH_SUFFIXES SDL2
)
find_path(SDL2_LIBRARY_PATH
NAMES SDL2-2.0.lib SDL2-2.0.a libSDL2-2.0.a libSDL2-2.0.so SDL2.lib SDL2.a libSDL2.a
)
find_library(SDL2_LIBRARY NAMES SDL2-2.0 SDL2 PATHS ${SDL2_LIBRARY_PATH})
set(HAVE_SDL2 False)
if(SDL2_INCLUDE_DIR AND SDL2_LIBRARY)
set(HAVE_SDL2 True)
include_directories("${SDL2_INCLUDE_DIR}")
endif()
# Choose the window system
set(VM_WINDOW_SYSTEM)
if(SUPPORT_TRADITIONAL_DISPLAY)
if(HAVE_SDL2)
set(VM_WINDOW_SYSTEM
platforms/minheadless/sdl2-window/sqWindow-SDL2.c
)
set(VM_DEPENDENCIES_LIBRARIES ${SDL2_LIBRARY} ${VM_DEPENDENCIES_LIBRARIES})
endif()
endif()
# Different source categories
set(VM_COMMON_SOURCES
platforms/Cross/vm/sq.h
platforms/Cross/vm/sqAssert.h
platforms/Cross/vm/sqAtomicOps.h
platforms/Cross/vm/sqCircularQueue.h
platforms/Cross/vm/sqCogStackAlignment.h
platforms/Cross/vm/sqExternalSemaphores.c
platforms/Cross/vm/sqHeapMap.c
platforms/Cross/vm/sqMemoryAccess.h
platforms/Cross/vm/sqMemoryFence.h
platforms/Cross/vm/sqNamedPrims.c
platforms/Cross/vm/sqPath.h
platforms/Cross/vm/sqPath.c
platforms/Cross/vm/sqSCCSVersion.h
platforms/Cross/vm/sqTextEncoding.h
platforms/Cross/vm/sqTextEncoding.c
platforms/Cross/vm/sqTicker.c
platforms/Cross/vm/sqVirtualMachine.h
platforms/Cross/vm/sqVirtualMachine.c
)
include_directories(
platforms/minheadless/common
)
set(VM_PLATFORM_COMMON_SOURCES
platforms/minheadless/common/sqaio.h
platforms/minheadless/common/sqConfig.h
platforms/minheadless/common/sqEventCommon.h
platforms/minheadless/common/sqNamedPrims.h
platforms/minheadless/common/sqPlatformSpecific.h
platforms/minheadless/common/sqPlatformSpecificCommon.h
platforms/minheadless/common/sqInternalPrimitives.c
platforms/minheadless/common/sqExternalPrimitives.c
platforms/minheadless/common/sqEventCommon.c
platforms/minheadless/common/sqPrinting.c
platforms/minheadless/common/sqWindow-Null.c
platforms/minheadless/common/sqWindow-Dispatch.c
platforms/minheadless/common/sqVirtualMachineInterface.c
)
if(UNIX)
include_directories(
platforms/minheadless/unix
)
set(VM_PLATFORM_SOURCES
platforms/minheadless/unix/aioUnix.c
platforms/minheadless/unix/sqPlatformSpecific-Unix.h
platforms/minheadless/unix/sqPlatformSpecific-Unix.c
platforms/minheadless/unix/sqUnixCharConv.c
platforms/minheadless/unix/sqUnixThreads.c
platforms/minheadless/unix/sqUnixHeartbeat.c
${VM_PLATFORM_SOURCES}
)
if(SPUR_OBJECT_MODEL)
set(VM_PLATFORM_SOURCES
platforms/minheadless/unix/sqUnixSpurMemory.c
${VM_PLATFORM_SOURCES}
)
else()
set(VM_PLATFORM_SOURCES
platforms/minheadless/unix/sqUnixMemory.c
${VM_PLATFORM_SOURCES}
)
endif()
set(VM_DEPENDENCIES_LIBRARIES pthread ${VM_DEPENDENCIES_LIBRARIES})
if(APPLE)
add_definitions(-DBUILD_FOR_OSX=1)
else()
add_definitions(-D_GNU_SOURCE)
endif()
elseif(WIN32)
include_directories(
platforms/minheadless/windows
)
set(VM_PLATFORM_SOURCES
platforms/minheadless/windows/sqWin32Alloc.h
platforms/minheadless/windows/sqWin32HandleTable.h
platforms/minheadless/windows/sqPlatformSpecific-Win32.h
platforms/minheadless/windows/sqPlatformSpecific-Win32.c
platforms/minheadless/windows/sqWin32.h
platforms/minheadless/windows/sqWin32Alloc.c
platforms/minheadless/windows/sqWin32SpurAlloc.c
platforms/minheadless/windows/sqWin32Backtrace.c
platforms/minheadless/windows/sqWin32Common.c
platforms/minheadless/windows/sqWin32Directory.c
platforms/minheadless/windows/sqWin32Heartbeat.c
platforms/minheadless/windows/sqWin32Stubs.c
platforms/minheadless/windows/sqWin32Threads.c
platforms/minheadless/windows/sqWin32Time.c
${VM_PLATFORM_SOURCES}
)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-DUNICODE
-D_UNICODE
-DWIN32_FILE_SUPPORT
-DNO_SERVICE
-DNO_STD_FILE_SUPPORT
-Dsetjmp=_setjmp
-D_WIN32_WINNT=0x501
-DWINVER=0x501
-DWIN32=1
)
set(VM_DEPENDENCIES_LIBRARIES Winmm ${VM_DEPENDENCIES_LIBRARIES})
if(SQUEAK_PLATFORM_X86_32)
if(MSVC)
# add_definitions(-DALLOCA_LIES_SO_USE_GETSP=0)
else()
endif()
add_definitions(
-DX86
)
endif()
else()
set(VM_PLATFORM_SOURCES
platforms/minheadless/generic/sqPlatformSpecific-Generic.h
platforms/minheadless/generic/sqPlatformSpecific-Generic.c
${VM_PLATFORM_SOURCES}
)
endif()
set(VM_SOURCES
${VM_COMMON_SOURCES}
${VM_FAVLOR_SOURCES}
${VM_PLATFORM_COMMON_SOURCES}
${VM_PLATFORM_SOURCES}
${VM_WINDOW_SYSTEM}
)
source_group("VM Common Sources" FILES ${VM_COMMON_SOURCES})
source_group("VM Flavor Sources" FILES ${VM_FAVLOR_SOURCES})
source_group("VM Platform Common Sources" FILES ${VM_PLATFORM_COMMON_SOURCES})
source_group("VM Platform Sources" FILES ${VM_PLATFORM_SOURCES})
source_group("VM Window System" FILES ${VM_WINDOW_SYSTEM})
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Plugins.cmake")
# Generate the config dot h.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platforms/minheadless/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
if(NOT ONLY_CONFIG_H)
include_directories(${CMAKE_BINARY_DIR})
# Build the VM core library
set(VM_CORE_LIBRARY_TYPE STATIC)
#if(WIN32)
# set(VM_CORE_LIBRARY_TYPE SHARED)
#endif()
if("${VM_CORE_LIBRARY_TYPE}" STREQUAL "STATIC")
add_definitions(-DBUILD_OSVM_STATIC)
endif()
add_library(${VM_LIBRARY_NAME} ${VM_CORE_LIBRARY_TYPE} ${VM_SOURCES} ${VM_INTERNAL_PLUGIN_SOURCES})
target_compile_definitions(${VM_LIBRARY_NAME} PRIVATE
-DSQUEAK_BUILTIN_PLUGIN
-DBUILD_VM_CORE
)
# Build the VM executable(s)
add_executable(${VM_EXECUTABLE_NAME} platforms/minheadless/common/sqMain.c)
target_link_libraries(${VM_EXECUTABLE_NAME} ${VM_LIBRARY_NAME} ${VM_DEPENDENCIES_LIBRARIES})
if(WIN32)
add_executable(${VM_EXECUTABLE_NAME}w WIN32 platforms/minheadless/windows/sqWin32Main.c)
target_link_libraries(${VM_EXECUTABLE_NAME}w ${VM_LIBRARY_NAME} ${VM_DEPENDENCIES_LIBRARIES})
endif()
endif()