Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Port node v0.10.40 to Visual Studio 2015 #7

Open
wants to merge 2 commits into
base: v0.10.40-release
Choose a base branch
from
Open
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
12 changes: 8 additions & 4 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
'RuntimeLibrary': 3, # MDd
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
Expand Down Expand Up @@ -96,7 +96,7 @@
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2, # MD
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
Expand Down Expand Up @@ -171,7 +171,7 @@
}],
[ '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-rtti', '-fno-exceptions', '-std=c++11' ],
'ldflags': [ '-pthread', '-rdynamic' ],
'target_conditions': [
['_type=="static_library"', {
Expand All @@ -198,6 +198,10 @@
['OS=="mac"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'GCC_OPTIMIZATION_LEVEL': '3',
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
Expand All @@ -207,7 +211,7 @@
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
'MACOSX_DEPLOYMENT_TARGET': '10.9', # -mmacosx-version-min=10.9
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def configure_winsdk(o):

winsdk_dir = os.environ.get("WindowsSdkDir")

if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'):
if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\x64\\ctrpp.exe'):
print "Found ctrpp in WinSDK--will build generated files into tools/msvs/genfiles."
o['variables']['node_has_winsdk'] = 'true'
return
Expand Down Expand Up @@ -724,7 +724,7 @@ if options.use_ninja:
elif options.use_xcode:
gyp_args += ['-f', 'xcode']
elif flavor == 'win':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=2013']
else:
gyp_args += ['-f', 'make-' + flavor]

Expand Down
8 changes: 4 additions & 4 deletions deps/cares/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['library=="static_library"', {
'RuntimeLibrary': 1 # static debug
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': 3 # DLL debug
'RuntimeLibrary': 3 # MDd
}]
],
'Optimization': 0, # /Od, no optimization
Expand Down Expand Up @@ -49,9 +49,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['library=="static_library"', {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2 # MD
}, {
'RuntimeLibrary': 2, # debug release
'RuntimeLibrary': 2 # MD
}],
],
'Optimization': 3, # /Ox, full optimization
Expand Down
4 changes: 2 additions & 2 deletions deps/http_parser/http_parser.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
'defines': [ 'DEBUG', '_DEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
'RuntimeLibrary': 3 # MDd
},
},
},
'Release': {
'defines': [ 'NDEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2 # MD
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions deps/openssl/openssl/e_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,15 @@ static __inline unsigned int _strlen31(const char *str)
# undef isxdigit
# endif
# if defined(_MSC_VER) && !defined(_DLL) && defined(stdin)
# if _MSC_VER>=1300
# if _MSC_VER>=1300 && _MSC_VER<1900
# undef stdin
# undef stdout
# undef stderr
FILE *__iob_func();
# define stdin (&__iob_func()[0])
# define stdout (&__iob_func()[1])
# define stderr (&__iob_func()[2])
# elif defined(I_CAN_LIVE_WITH_LNK4049)
# elif _MSC_VER<1900 && defined(I_CAN_LIVE_WITH_LNK4049)
# undef stdin
# undef stdout
# undef stderr
Expand Down
8 changes: 4 additions & 4 deletions deps/uv/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['library=="static_library"', {
'RuntimeLibrary': 1, # static debug
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': 3, # DLL debug
'RuntimeLibrary': 3 # MDd
}],
],
'Optimization': 0, # /Od, no optimization
Expand Down Expand Up @@ -57,9 +57,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['library=="static_library"', {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2 # MD
}, {
'RuntimeLibrary': 2, # debug release
'RuntimeLibrary': 2 # MD
}],
],
'Optimization': 3, # /Ox, full optimization
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@

'conditions': [
['OS=="win" and component=="shared_library"', {
'RuntimeLibrary': '3', # /MDd
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': '1', # /MTd
'RuntimeLibrary': 3 # MDd
}],
],
},
Expand Down Expand Up @@ -409,9 +409,9 @@
'StringPooling': 'true',
'conditions': [
['OS=="win" and component=="shared_library"', {
'RuntimeLibrary': '2', #/MD
'RuntimeLibrary': 2 # MD
}, {
'RuntimeLibrary': '0', #/MT
'RuntimeLibrary': 2 # MD
}],
['v8_target_arch=="x64"', {
# TODO(2207): remove this option once the bug is fixed.
Expand Down
3 changes: 3 additions & 0 deletions deps/zlib/zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#if _MSC_VER>=1900
# define STDC99
#endif
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
Expand Down
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ static Handle<Value> EnvSetter(Local<String> property,
WCHAR* key_ptr = reinterpret_cast<WCHAR*>(*key);
// Environment variables that start with '=' are read-only.
if (key_ptr[0] != L'=') {
SetEnvironmentVariableW(key_ptr, reinterpret_cast<WCHAR*>(*val));
_wputenv_s(key_ptr, reinterpret_cast<WCHAR*>(*val));
}
#endif
// Whether it worked or not, always return rval.
Expand Down
15 changes: 13 additions & 2 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if /i "%1"=="/?" goto help

@rem Process arguments.
set config=Release
set platform=Win32
set msiplatform=x86
set target=Build
set target_arch=ia32
Expand Down Expand Up @@ -77,6 +78,7 @@ if defined jslint goto jslint

if "%config%"=="Debug" set debug_arg=--debug
if "%target_arch%"=="x64" set msiplatform=x64
if "%target_arch%"=="x64" set platform=x64
if defined nosnapshot set nosnapshot_arg=--without-snapshot
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
Expand All @@ -100,6 +102,15 @@ ENDLOCAL
@rem Skip project generation if requested.
if defined nobuild goto sign

@rem Look for Visual Studio 2015
if not defined VS140COMNTOOLS goto vc-set-2013
if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat"
if not defined VCINSTALLDIR goto msbuild-not-found
set GYP_MSVS_VERSION=2015
goto msbuild-found

:vc-set-2013
@rem Look for Visual Studio 2013
if not defined VS120COMNTOOLS goto vc-set-2012
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
Expand Down Expand Up @@ -130,7 +141,7 @@ goto run

:msbuild-found
@rem Build the sln with msbuild.
msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
msbuild node.sln /m:%NUMBER_OF_PROCESSORS% /p:BuildInParallel=true /toolsversion:14.0 /p:PlatformToolset=v140 /t:%target% /p:Configuration=%config% /p:Platform=%platform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit

:sign
Expand Down Expand Up @@ -197,7 +208,7 @@ if "%test%"=="test" goto jslint
goto exit

:create-msvs-files-failed
echo Failed to create vc project files.
echo Failed to create vc project files.
goto exit

:upload
Expand Down