Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add node_module_version to config.gypi #7808

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
'cflags_cc': [
'-fno-delete-null-pointer-checks',
'-fno-exceptions',
'-fno-rtti',
],
'ldflags': [ '-pthread', '-rdynamic' ],
'target_conditions': [
['_type=="static_library"', {
Expand Down
2 changes: 2 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,8 @@ def configure_node(o):
else:
o['variables']['node_tag'] = ''

o['variables']['node_module_version'] = 11


def configure_libz(o):
o['variables']['node_shared_zlib'] = b(options.shared_zlib)
Expand Down
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'node_use_openssl%': 'true',
'node_use_systemtap%': 'false',
'node_shared_openssl%': 'false',
'node_module_version%': '',
'library_files': [
'src/node.js',
'lib/_debugger.js',
Expand Down
10 changes: 10 additions & 0 deletions test/simple/test-module-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';
require('../common');
var assert = require('assert');
Copy link
Member

@jasnell jasnell Aug 18, 2016

Choose a reason for hiding this comment

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

can you use const here please :-)

Copy link
Member

Choose a reason for hiding this comment

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

ugh.. ha! nevermind... v0.10.... silly me

Copy link
Author

Choose a reason for hiding this comment

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

Do you think we might actually want to add const in the current trunk?

var assert = require('assert');

Copy link
Member

Choose a reason for hiding this comment

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

We should be using const in master, definitely, but by itself that's not enough of a reason to update the test case if it's not using const already. Best to leave it unless there are other changes to make.


// Check for existence
assert(process.config.variables.hasOwnProperty('node_module_version'));

// Ensure that `node_module_version` is an Integer
assert(!Number.isNaN(parseInt(process.config.variables.node_module_version)));
assert.strictEqual(process.config.variables.node_module_version, 11);