-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rybfile
85 lines (69 loc) · 3.22 KB
/
Rybfile
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
# ===-- Rybfile ------------------------------------------*- mode: Ruby -*-=== #
#
# __
# | | ___ ___ _____
# | |__| . | . | |
# |_____|___|___|_|_|_|
#
# This file is distributed under the terms described in LICENSE.
#
# ===----------------------------------------------------------------------=== #
project :loom, pretty: 'Loom' do |proj|
# Dynamically linking to Loom doesn't make much sense.
proj.define 'LOOM_LINKAGE' => 'LOOM_LINKAGE_STATIC'
# Supress all of Visual Studio's bullshit.
# TODO(mtwilliams): Refactor into Ryb.
proj.define '_HAS_EXCEPTIONS' => false,
'_SCL_SECURE_NO_WARNINGS' => true,
'_CRT_SECURE_NO_WARNINGS' => true,
'_CRT_SECURE_NO_DEPRECATE' => true,
'_SECURE_SCL_THROWS' => false,
'_SILENCE_DEPRECATION_OF_SECURE_SCL_THROWS' => true,
# See http://stackoverflow.com/questions/14363929
'_USING_V110_SDK71_' => true
# Suffix builds in the form: _{configuration}_{platform}_{32,64}.
# e.g. libloom_macosx_64.dylib or loom_windows_32.dll
proj.architecture :x86 do |arch| arch.suffix = '_32'; end
proj.architecture :x86_64 do |arch| arch.suffix = '_64'; end
proj.platform :windows do |platform| platform.suffix = '_windows'; end
proj.platform :macosx do |platform| platform.suffix = '_macosx'; end
proj.platform :linux do |platform| platform.suffix = '_linux'; end
proj.configuration :debug do |config| config.suffix = '_debug'; end
proj.configuration :release do |config| config.suffix = '_release'; end
proj.configuration :debug, pretty: 'Debug' do |config|
config.define 'LOOM_CONFIGURATION' => 'LOOM_CONFIGURATION_DEBUG'
config.define '_DEBUG' => true,
'_HAS_ITERATOR_DEBUGGING' => true,
'_SECURE_SCL' => true
config.generate_debug_symbols = true
config.link_time_code_generation = false
config.optimize = :nothing
end
proj.configuration :release, pretty: 'Release' do |config|
config.define 'LOOM_CONFIGURATION' => 'LOOM_CONFIGURATION_RELEASE'
config.define 'NDEBUG' => true,
'_HAS_ITERATOR_DEBUGGING' => false,
'_SECURE_SCL' => false
config.generate_debug_symbols = true
config.link_time_code_generation = true
config.optimize = :speed
end
proj.library :loom, pretty: 'Loom' do |lib|
lib.linkage = :static
lib.author = 'Origami Comet Games, Inc.'
lib.description = 'A lightweight task scheduler.'
lib.license = 'CC0'
lib.define '__LOOM_IS_BEING_COMPILED__' => true
lib.define '__LOOM_VERSION__' => "\"\\\"#{`git rev-parse HEAD`.rstrip}\\\"\""
lib.define '__LOOM_REVISION__' => `git rev-list --count HEAD`.strip.to_i
lib.add_include_paths 'include/'
lib.add_library_paths '$build/lib/', '$build/bin/'
lib.add_binary_paths '$build/bin/'
lib.add_source_files 'include/**/*.h'
# HACK(mtwilliams): Force compilation as C++ because Visual C doesn't do C99.
lib.add_source_files 'src/**/*.c', language: :cpp
lib.platform :windows do |platform|
platform.add_external_dependencies %w(kernel32 user32 advapi32)
end
end
end