window 下生成NodeJs(v8.9.3) 的 VS2015 解决方案node.sln

使用步骤 也可以参照 github:

https://github.com/nodejs/node/blob/master/BUILDING.md#windows-1

1. 从 github 同步

https://github.com/nodejs/node

2.安装 python 2.7 或者 2.6

https://www.python.org/downloads/

当然, 如果有Python 环境, 就跳过好了

3. 修改 common.gypi

因为如果 不修改的话, 会报好多错误的....

E:\Projects\C++\node-git\trunk\tools>gyp_node.py  -Dtarget_arch=x64 -f msvs
gyp: name 'node_shared' is not defined while evaluating condition 'node_shared=="true"' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'node_shared' is not defined while evaluating condition 'node_shared=="true"' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'node_use_openssl' is not defined while evaluating condition 'OS=="win" and node_use_openssl=="true" and node_shared_openssl=="false"' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'node_shared_openssl' is not defined while evaluating condition 'OS=="win" and node_use_openssl=="true" and node_shared_openssl=="false"' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'v8_enable_inspector' is not defined while evaluating condition 'v8_enable_inspector==1' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'node_enable_d8' is not defined while evaluating condition 'node_enable_d8=="true"' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'node_release_urlbase' is not defined while evaluating condition 'node_release_urlbase!=""' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'debug_http2' is not defined while evaluating condition 'debug_http2==1' in E:\Projects\C++\node-git\trunk\node.gyp E:\Projects\C++\node-git\trunk\tools>gyp_node.py -Dtarget_arch=x64 -f msvs
gyp: name 'v8_enable_i18n_support' is not defined while evaluating condition 'v8_enable_i18n_support==1' in E:\Projects\C++\node-git\trunk\node.gyp

好多变量都没有定义.....

下面是修改的部分(红色粗体字,变量值是我自己的缺少设置,可以改), 文件在主目录下

{
'variables': {
'asan%': 0,
'werror': '', # Turn off -Werror in V8 build.
'visibility%': 'hidden', # V8's visibility setting
'target_arch%': 'ia32', # set v8's target architecture
'host_arch%': 'ia32', # set v8's host architecture
'want_separate_host_toolset%': 0, # V8 should not build target and host
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
'component%': 'static_library', # NB. these names match with what V8 expects
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
'python%': 'python', 'node_shared': 'false',
'node_enable_d8': 'false',
'v8_enable_inspector': 1,
'v8_enable_i18n_support': 'true',
'debug_http2': 1,
'debug_nghttp2': 1,
'node_use_openssl': 'false',
'node_shared_openssl': 'true',
'openssl_fips': '',
'node_release_urlbase': '', 'node_shared%': 'false',
'force_dynamic_crt%': 0,
'node_use_v8_platform%': 'true',
'node_use_bundled_v8%': 'true',
'node_module_version%': '',
.....

4.修改 deps\v8\src\v8.gyp

貌似调用 deps\v8\src\v8.gyp 的时候, 有个参数没有传进去,target_arch的值我用的 是 'x64':

E:\Projects\C++\node-git\trunk\tools>gyp_node.py  -Dtarget_arch=x64 -f msvs
gyp: name 'debug_nghttp2' is not defined while evaluating condition 'debug_nghttp2 == 1' in E:\Projects\C++\node-git\trunk\deps\nghttp2\nghttp2.gyp
gyp: Undefined variable target_arch in E:\Projects\C++\node-git\trunk\deps\v8\src\v8.gyp

所以,手动加了这个变量

{
'variables': {
'target_arch': 'x64', 'v8_code': 1,
.....

5. 生成 解决方案

一般来说,使用 gyp 生成 VS 的解决方案的, 都是 使用类似的 命令行:

"gyp_XXXX.py  -Dtarget_arch=x64 -f msvs"    XXXX 就是工程/解决方案名,例如 V8的 就是 gyp_V8.gyp; Node的就是gyp_node.gyp
tools>gyp_node.py  -Dtarget_arch=x64 -f msvs

Over!

6.如果 用 vcbuild.bat 生成, 就不会有这些错误

以上是直接 运行 gyp_node.py  会产生 缺少 变量,  但是 如果 用 vcbuild.bat, 就不会.  >>git上有issue说明<< ^_^

window 下生成NodeJs(v8.9.3) 的 VS2015 解决方案node.sln的更多相关文章

  1. Window下配置NodeJs环境详解

        今年打算学习Web这块,所以就买了本Node.js+MongoDb+AngularJS这本书,这周天也比较忙,想着录视频(拍小片,不是AV,不要误会,是在线课程)的事情,这周又将Asp.Net ...

  2. Window下对nodejs多版本管理GNVM

    Windows下对nodejs多版本的管理,实现随意切换! 官方地址: https://github.com/Kenshin/gnvm http://ksria.com/gnvm/ 01.下载GNVM ...

  3. Window下生成OpenSSL自签证书

    :OPenSSL下载地址:https://www.openssl.org/source/ 编译好的OpenSSL下载地址: http://slproweb.com/products/Win32Open ...

  4. window下,nodejs 安装 http-server,开启命令行HTTP服务器

    第一步:http://nodejs.cn/  官网下载安装文件,安装nodejs: 第二步:运行中输入cmd进入命令行模式,输入  node -v ,显示版本号,代表安装成功: 第三步:在node命令 ...

  5. linux和window下生成任意大小的文件

    在Windows环境下的实现方法   使用fsutil命令,在windows xp和win 7下应该都自带了这个命令.命令的格式是 fsutil file createnew 新文件名 文件大小.例如 ...

  6. window下安装nodejs

    下载nodejs 去https://nodejs.org/en/download/下载nodejs,有.mis(安装版)和.exe(二进制版) .mis(安装版) 一般下载这个就行,简单方便,自带np ...

  7. window下,nodejs安装http-server,并开启HTTP服务器

    1.下载nodejs  官方下载地址:https://nodejs.org/en/ 2.在cmd命令中,输入node -v 输入出版本号,代表安装成功. 3.输入 npm install http-s ...

  8. window下golang生成静态库给C语言调用

    buidmod为c-archive能在window下生成 ,c-shared则不行 1.golang生成c-archive静态库 main.go package main import "C ...

  9. window下nodejs用nodemon启动koa2项目(用cmd启动不了,要用Git Bash Here 启动才可以)

    window下nodejs用nodemon启动koa2项目(用cmd启动不了,要用Git Bash Here 启动才可以)nodemon --watch 'app/**/*' -e ts --exec ...

随机推荐

  1. win7下IIS的安装和配置

    win7下IIS的安装和配置 图文教程,需要的朋友可以参考下 http://www.jb51.net/article/29787.htm 最近工作需要IIS,自己的电脑又是Windows7系统,找了下 ...

  2. dedecms系统后台登陆提示用户名密码不存在

    dedecms最近被曝有非常多的安全漏洞,最近有些用户反应后台管理员账号密码没有修改但无法正常登陆,提示用户名不存在,经研究发现是程序漏洞管理员被直接篡改,解决方案如下. 工具/原料 dedecms ...

  3. kafka和strom集群的环境安装

    前言 storm和kafka集群安装是没有必然联系的,我将这两个写在一起,是因为他们都是由zookeeper进行管理的,也都依赖于JDK的环境,为了不重复再写一遍配置,所以我将这两个写在一起.若只需一 ...

  4. J.U.C ThreadPoolExecutor解析

    Java里面线程池顶级接口是Executor,但严格意义上讲Executor并不是一个线程池,而是一个线程执行工具,真正的线程池接口是ExecutorService.关系类图如下: 首先Executo ...

  5. socket编程--相关函数--sendto();read();

    {1} 头文件:#include <sys/types.h>   #include <sys/socket.h>定义函数:int sendto(int s, const voi ...

  6. Velocity动态拼接字符串

    1.在全局定义一个变量: #set($varName = "") 2.拼接字符串病截取字符串: #foreach( $role in $adminUser.roles) #set( ...

  7. python3 第十三章 - 数据类型之tuple(元组)

    元组与列表类似,不同之处在于元组的元素不能修改. 元组使用小括号,列表使用方括号. 元组创建很简单,只需要在括号中添加元素,并使用逗号隔开即可: language = ('c', 'c++', 'py ...

  8. Asp.net core 2.0.1 Razor 的使用学习笔记(三)

    ASP.net core 2.0.0 中 asp.net identity 2.0.0 的基本使用(二)—用户账户及cookie配置 修改用户账户及cookie配置 一.修改密码强度和用户邮箱验证规则 ...

  9. 【nginx】nginx解决跨域详解

    使用场景:本地运行一个项目,但是要访问外域的api接口,存在跨域问题,解决方式有很多,但我尝试用nginx解决,搜索了网上文章后再加上尝试终于成功, 其中一些注意事项和大家分享一下. 一.window ...

  10. __call PHP伪重载方法

    为了避免当调用的方法不存在时产生错误,可以使用 __call() 方法来避免.该方法在调用的方法不存在时会自动调用,程序仍会继续执行下去 该方法有两个参数,第一个参数 $function_name 会 ...