diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp new file mode 100644 index 00000000000..986e45e3268 --- /dev/null +++ b/lcidlc/lcidlc.gyp @@ -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', + }, + ], + ], + + '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', + ], + }, + ], + }, + ], +} diff --git a/livecode.gyp b/livecode.gyp index df875a48a8f..ce49e92a97e 100644 --- a/livecode.gyp +++ b/livecode.gyp @@ -20,6 +20,9 @@ # Widgets and libraries 'extensions/extensions.gyp:extensions', + + # lcidlc + 'lcidlc/lcidlc.gyp:lcidlc', ], 'conditions': diff --git a/util/encode_source.pl b/util/encode_source.pl index 145a5f19be9..d3de3a5ae45 100755 --- a/util/encode_source.pl +++ b/util/encode_source.pl @@ -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