Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
135 changes: 135 additions & 0 deletions lcidlc/lcidlc.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
# ----- lcidlc -----
'includes':
[
'../common.gypi',
],

'targets':
[
{
'target_name': 'lcidlc',
'type': 'executable',

'dependencies':
[
'../libfoundation/libfoundation.gyp:libFoundation',
'encode_support',
],

'include_dirs':
[
'include',
'src',
],

'sources':
[
'include/LiveCode.h',

'src/Coder.h',
'src/Coder.cpp',
'src/CString.h',
'src/CString.cpp',
'src/Error.h',
'src/Error.cpp',
'src/Interface.h',
'src/Interface.cpp',
'src/InterfaceGenerate.cpp',
'src/InterfacePrivate.h',
'src/Main.cpp',
'src/NativeType.h',
'src/NativeType.cpp',
'src/Parser.h',
'src/Parser.cpp',
'src/Position.h',
'src/Position.cpp',
'src/Scanner.h',
'src/Scanner.cpp',
'src/Value.h',
'src/Value.cpp',

'<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedJavaSupport.c',
'<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedSupport.c',
],

'conditions':
[
[
# Don't compile on android, iOS or emscripten
'OS == "android" or OS == "ios" or OS == "emscripten"',
{
'type': 'none',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a missing ']' here (JSON definitely isn't the easiest build configuration syntax to read!).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now. Would be handy if it were standard JSON so we could run a validator on it. It seemed to work so obviously gyp isn't overly fussy...

],
],

'msvs_settings':
{
'VCLinkerTool':
{
'SubSystem': 1, # /SUBSYSTEM:CONSOLE
},
},
},
{
'target_name': 'encode_support',
'type': 'none',

'sources':
[
'src/Support.java',
'src/Support.mm',
],

'actions':
[
{
'action_name': 'Encode Support.mm',

'inputs':
[
'../util/encode_source.pl',
'src/Support.mm',
],
'outputs':
[
'<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedSupport.c',
],

'action':
[
'<@(perl)',
'../util/encode_source.pl',
'src/Support.mm',
'<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedSupport.c',
'g_support_template',
],
},
{
'action_name': 'Encode Support.java',

'inputs':
[
'../util/encode_source.pl',
'src/Support.java',
],

'outputs':
[
'<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedJavaSupport.c',
],

'action':
[
'<@(perl)',
'../util/encode_source.pl',
'src/Support.java',
'<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedJavaSupport.c',
'g_java_support_template',
],
},
],
},
],
}
3 changes: 3 additions & 0 deletions livecode.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

# Widgets and libraries
'extensions/extensions.gyp:extensions',

# lcidlc
'lcidlc/lcidlc.gyp:lcidlc',
],

'conditions':
Expand Down
6 changes: 5 additions & 1 deletion util/encode_source.pl
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/usr/bin/env perl

use warnings;
use File::Basename;

# Incoming arguments
my $sourceFile = $ARGV[0];
my $destFile = $ARGV[1];
my $varName = $ARGV[2];

# Work around gyp issue on windows where it is
# sometimes too eager in relativising paths
my $varName = basename($ARGV[2]);

#! /usr/bin/revolution -ui

Expand Down