Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 0819807

Browse files
committed
[[ Build ]] Tweak the way builtin modules are compiled
This patch changes the gyp files for the engine build so that builtin engine modules are compiled into the end-point exe/lib rather than into a static library. It also fixes some dependency issues with packaged_extensions and modules which means '-jN' on make based systems should work correctly.
1 parent 2e41261 commit 0819807

File tree

7 files changed

+75
-83
lines changed

7 files changed

+75
-83
lines changed

engine/engine.gyp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,14 @@
151151

152152
'../libfoundation/libfoundation.gyp:libFoundation',
153153
'../libgraphics/libgraphics.gyp:libGraphics',
154+
155+
'lcb-modules.gyp:engine_lcb_modules',
154156
],
155157

156158
'sources':
157159
[
158160
'<@(engine_security_source_files)',
161+
'>@(builtin_lcb_modules)',
159162
'src/main.cpp',
160163
],
161164

@@ -195,7 +198,7 @@
195198
{
196199
'target_name': 'standalone',
197200
'product_name': 'standalone-community',
198-
201+
199202
'includes':
200203
[
201204
'app-bundle-template.gypi',
@@ -210,10 +213,12 @@
210213
[
211214
'kernel-standalone.gyp:kernel-standalone',
212215
'engine-common.gyp:security-community',
216+
'lcb-modules.gyp:engine_lcb_modules',
213217
],
214218

215219
'sources':
216220
[
221+
'>@(builtin_lcb_modules)',
217222
'src/dummy.cpp',
218223
'rsrc/standalone.rc',
219224
],
@@ -466,11 +471,6 @@
466471
},
467472
},
468473

469-
'sources':
470-
[
471-
'<(PRODUCT_DIR)/obj.target/engine_lcb_modules/geni/engine_lcb_modules.o',
472-
],
473-
474474
'sources!':
475475
[
476476
'src/dummy.cpp',
@@ -532,12 +532,14 @@
532532
[
533533
'kernel-installer.gyp:kernel-installer',
534534
'engine-common.gyp:security-community',
535+
'lcb-modules.gyp:engine_lcb_modules',
535536
],
536537

537538
'sources':
538539
[
539540
'src/dummy.cpp',
540541
'rsrc/installer.rc',
542+
'>@(builtin_lcb_modules)',
541543
],
542544

543545
'conditions':
@@ -622,12 +624,14 @@
622624
'kernel-development.gyp:kernel-development',
623625
'encode_environment_stack',
624626
'engine-common.gyp:security-community',
627+
'lcb-modules.gyp:engine_lcb_modules',
625628
],
626629

627630
'sources':
628631
[
629632
'<(SHARED_INTERMEDIATE_DIR)/src/startupstack.cpp',
630633
'rsrc/development.rc',
634+
'>@(builtin_lcb_modules)',
631635
],
632636

633637
'conditions':
@@ -821,12 +825,14 @@
821825
[
822826
'kernel-standalone.gyp:kernel-standalone',
823827
'engine-common.gyp:security-community',
828+
'lcb-modules.gyp:engine-lcb-modules',
824829
],
825830

826831
'sources':
827832
[
828833
'src/dummy.cpp',
829834
'src/main.cpp',
835+
'>@(builtin_lcb_modules)',
830836
],
831837

832838
'include_dirs':

engine/kernel-development.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'module_test_sources':
1313
[
1414
'<@(engine_test_source_files)',
15-
'<(SHARED_INTERMEDIATE_DIR)/src/startupstack.cpp',
15+
'src/dummystartupstack.cpp',
1616
],
1717
'module_test_include_dirs':
1818
[

engine/kernel-server.gyp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747

4848
'dependencies':
4949
[
50-
'../libexternal/libexternal.gyp:libExternal',
50+
'../libfoundation/libfoundation.gyp:libFoundation',
51+
'../libgraphics/libgraphics.gyp:libGraphics',
52+
'../libscript/libscript.gyp:libScript',
53+
'../libscript/libscript.gyp:stdscript',
5154

5255
'../prebuilt/libcurl.gyp:libcurl',
5356
'../prebuilt/libopenssl.gyp:libopenssl',

engine/kernel.gyp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
'dependencies':
1515
[
1616
'../libfoundation/libfoundation.gyp:libFoundation',
17-
#'../libexternal/libexternal.gyp:libExternal',
1817
'../libgraphics/libgraphics.gyp:libGraphics',
1918
'../libscript/libscript.gyp:libScript',
19+
'../libscript/libscript.gyp:stdscript',
2020

2121
'../libbrowser/libbrowser.gyp:libbrowser',
2222

@@ -31,8 +31,6 @@
3131

3232
'engine-common.gyp:encode_version',
3333
'engine-common.gyp:quicktime_stubs',
34-
35-
'lcb-modules.gyp:engine_lcb_modules',
3634
],
3735

3836
'include_dirs':

engine/lcb-modules.gyp

Lines changed: 23 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,79 +10,29 @@
1010
[
1111
{
1212
'target_name': 'engine_lcb_modules',
13-
'type': 'static_library',
13+
'type': 'none',
1414

1515
'dependencies':
1616
[
17-
'../libscript/libscript.gyp:stdscript',
18-
'../toolchain/lc-compile/lc-compile.gyp:lc-compile',
17+
'../toolchain/lc-compile/lc-compile.gyp:lc-compile#host',
1918
],
2019

2120
'all_dependent_settings':
2221
{
2322
'variables':
2423
{
24+
'builtin_lcb_modules':
25+
[
26+
'<(SHARED_INTERMEDIATE_DIR)/engine_lcb_modules.cpp',
27+
],
28+
2529
'dist_aux_files':
2630
[
2731
# Gyp will only use a recursive xcopy on Windows if the path ends with '/'
2832
'<(PRODUCT_DIR)/modules/',
2933
],
3034
},
3135
},
32-
33-
'conditions':
34-
[
35-
[
36-
'OS == "win"',
37-
{
38-
'all_dependent_settings':
39-
{
40-
'msvs_settings':
41-
{
42-
'VCLinkerTool':
43-
{
44-
'AdditionalOptions':
45-
[
46-
'/WHOLEARCHIVE:<(PRODUCT_DIR)\lib\engine_lcb_modules.lib',
47-
],
48-
},
49-
},
50-
},
51-
},
52-
],
53-
[
54-
'OS == "mac" or OS == "ios"',
55-
{
56-
'all_dependent_settings':
57-
{
58-
'xcode_settings':
59-
{
60-
'OTHER_LDFLAGS':
61-
[
62-
'-force_load <(PRODUCT_DIR)/libengine_lcb_modules.a',
63-
],
64-
},
65-
},
66-
},
67-
],
68-
[
69-
'OS == "android" or OS == "linux"',
70-
{
71-
'direct_dependent_settings':
72-
{
73-
'link_settings':
74-
{
75-
'ldflags':
76-
[
77-
'-Wl,--whole-archive',
78-
'-Wl,<(PRODUCT_DIR)/obj.target/engine/libengine_lcb_modules.a',
79-
'-Wl,--no-whole-archive',
80-
],
81-
},
82-
},
83-
},
84-
],
85-
],
8636

8737
'actions':
8838
[
@@ -98,10 +48,23 @@
9848
'<@(stdscript_syntax_lcb_files)',
9949
'<@(stdscript_other_lcb_files)',
10050
],
101-
51+
52+
'conditions':
53+
[
54+
[
55+
'OS != "mac"',
56+
{
57+
'outputs':
58+
[
59+
'<(PRODUCT_DIR)/modules/',
60+
],
61+
},
62+
],
63+
],
64+
10265
'outputs':
10366
[
104-
'<(INTERMEDIATE_DIR)/engine_lcb_modules.cpp',
67+
'<(SHARED_INTERMEDIATE_DIR)/engine_lcb_modules.cpp',
10568

10669
# A specific output file is required here to ensure that
10770
# all build systems create the output directory while
@@ -116,7 +79,7 @@
11679
'--bootstrap',
11780
'--inputg', '../toolchain/lc-compile/src/grammar.g',
11881
'--outputi', '<(PRODUCT_DIR)/modules/lci',
119-
'--outputc', '<(INTERMEDIATE_DIR)/engine_lcb_modules.cpp',
82+
'--outputc', '<(SHARED_INTERMEDIATE_DIR)/engine_lcb_modules.cpp',
12083
'<@(_inputs)',
12184
],
12285
},

engine/src/dummystartupstack.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extern "C"
2+
{
3+
4+
char *MCstartupstack;
5+
unsigned int MCstartupstack_length;
6+
7+
}
8+

extensions/extensions.gyp

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,24 @@
4040
'cross-platform-extension-dependencies',
4141
],
4242

43-
'all_dependent_settings':
44-
{
45-
'variables':
46-
{
47-
'dist_aux_files':
48-
[
49-
# Gyp will only use a recursive xcopy on Windows if the path ends with '/'
50-
'<(PRODUCT_DIR)/packaged_extensions/',
51-
],
52-
},
53-
},
5443

5544
'conditions':
5645
[
5746
[
5847
'mobile == 0',
5948
{
49+
'all_dependent_settings':
50+
{
51+
'variables':
52+
{
53+
'dist_aux_files':
54+
[
55+
# Gyp will only use a recursive xcopy on Windows if the path ends with '/'
56+
'<(PRODUCT_DIR)/packaged_extensions/',
57+
],
58+
},
59+
},
60+
6061
'dependencies':
6162
[
6263
'lcs-extensions',
@@ -96,9 +97,22 @@
9697
'extension': 'livecodescript',
9798
'message': 'Building script extension <(RULE_INPUT_NAME)',
9899

100+
'conditions':
101+
[
102+
[
103+
'OS != "mac"',
104+
{
105+
'outputs':
106+
[
107+
'<(PRODUCT_DIR)/packaged_extensions/',
108+
],
109+
},
110+
],
111+
],
112+
99113
'outputs':
100114
[
101-
'<(PRODUCT_DIR)/packaged_extensions/com.livecode.library.<(RULE_INPUT_ROOT)/<(RULE_INPUT_ROOT).livecodescript',
115+
'<(PRODUCT_DIR)/packaged_extensions/com.livecode.library.<(RULE_INPUT_ROOT)/<(RULE_INPUT_ROOT).livecodescript',
102116
],
103117

104118
'action':

0 commit comments

Comments
 (0)