-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src,build: improve the native module subsystem
* Split `jsrs-impl.cc` into separate modules. * Make some refactoring. * Rename the native addon to `jstp` since there already is a function that is not a part of JSRS. * Fix `binding.gyp`: make `cflags` not ignored on macOS (as it appeared they used to be) and do not use `-O3` in Debug configuration. * Use a macro to throw V8 exceptions to avoid boilerplate code. Backport-of: #36
- Loading branch information
Showing
14 changed files
with
1,394 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
{ | ||
'variables': { | ||
'jstp_base_cflags': ['-Wall', '-Wextra', '-Wno-unused-parameter'], | ||
'jstp_debug_cflags': ['-g', '-O0'], | ||
'jstp_release_cflags': ['-O3'] | ||
}, | ||
'targets': [ | ||
{ | ||
'target_name': 'jsrs', | ||
'cflags': ['-O3'], | ||
'sources': ['src/jsrs-impl.cc'] | ||
'target_name': 'jstp', | ||
'sources': [ | ||
'src/node_bindings.cc', | ||
'src/jsrs_serializer.cc', | ||
'src/jsrs_parser.cc', | ||
'src/packet_parser.cc', | ||
'src/unicode_utils.cc' | ||
], | ||
'configurations': { | ||
'Debug': { | ||
'cflags': ['<@(jstp_debug_cflags)'], | ||
'xcode_settings': { | ||
'OTHER_CFLAGS': ['<@(jstp_debug_cflags)'] | ||
} | ||
}, | ||
'Release': { | ||
'cflags': ['<@(jstp_release_cflags)'], | ||
'xcode_settings': { | ||
'OTHER_CFLAGS': ['<@(jstp_release_cflags)'] | ||
} | ||
} | ||
}, | ||
'cflags': ['<@(jstp_base_cflags)'], | ||
'xcode_settings': { | ||
'OTHER_CFLAGS': ['<@(jstp_base_cflags)'] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) 2016-2017 JSTP project authors. Use of this source code is | ||
// governed by the MIT license that can be found in the LICENSE file. | ||
|
||
#ifndef SRC_COMMON_H_ | ||
#define SRC_COMMON_H_ | ||
|
||
#define THROW_EXCEPTION(ex_type, ex_msg) \ | ||
isolate->ThrowException(v8::Exception::ex_type( \ | ||
v8::String::NewFromUtf8(isolate, ex_msg))) | ||
|
||
#endif // SRC_COMMON_H_ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.