Skip to content

Commit

Permalink
windows: improve Visual Studio Express build support
Browse files Browse the repository at this point in the history
* Moved generated files to a clearer directory.
* Improved detection logic for ctrpp.exe tool.

Closes nodejs#4482
  • Loading branch information
sblom authored and piscisaureus committed Jan 3, 2013
1 parent 5a39df4 commit a616774
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 24 deletions.
13 changes: 6 additions & 7 deletions configure
Expand Up @@ -604,15 +604,14 @@ def configure_winsdk(o):
if not sys.platform.startswith('win32'):
return

try:
p = subprocess.Popen(['ctrpp.exe'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except OSError:
winsdk_dir = os.environ.get("WindowsSdkDir")

if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'):
print "Found ctrpp in WinSDK--will build generated files into tools/msvs/genfiles."
o['variables']['node_has_winsdk'] = 'true'
return

o['variables']['node_has_winsdk'] = 'true'
print "ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles."


output = {
Expand Down
26 changes: 13 additions & 13 deletions node.gyp
Expand Up @@ -73,7 +73,7 @@

'include_dirs': [
'src',
'src/gen',
'tools/msvs/genfiles',
'deps/uv/src/ares',
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
],
Expand Down Expand Up @@ -194,8 +194,8 @@
'src/node_win32_etw_provider-inl.h',
'src/node_win32_etw_provider.cc',
'src/node_dtrace.cc',
'src/gen/node_etw_provider.h',
'src/gen/node_etw_provider.rc',
'tools/msvs/genfiles/node_etw_provider.h',
'tools/msvs/genfiles/node_etw_provider.rc',
]
} ],
[ 'node_use_perfctr=="true"', {
Expand All @@ -206,7 +206,7 @@
'src/node_win32_perfctr_provider.cc',
'src/node_counters.cc',
'src/node_counters.h',
'src/gen/node_perfctr_provider.rc',
'tools/msvs/genfiles/node_perfctr_provider.rc',
]
} ],
[ 'node_shared_v8=="false"', {
Expand Down Expand Up @@ -295,11 +295,11 @@
'action_name': 'node_etw',
'inputs': [ 'src/res/node_etw_provider.man' ],
'outputs': [
'src/gen/node_etw_provider.rc',
'src/gen/node_etw_provider.h',
'src/gen/node_etw_providerTEMP.BIN',
'tools/msvs/genfiles/node_etw_provider.rc',
'tools/msvs/genfiles/node_etw_provider.h',
'tools/msvs/genfiles/node_etw_providerTEMP.BIN',
],
'action': [ 'mc <@(_inputs) -h src/gen -r src/gen' ]
'action': [ 'mc <@(_inputs) -h tools/msvs/genfiles -r tools/msvs/genfiles' ]
}
]
} ]
Expand All @@ -316,13 +316,13 @@
'action_name': 'node_perfctr_man',
'inputs': [ 'src/res/node_perfctr_provider.man' ],
'outputs': [
'src/gen/node_perfctr_provider.h',
'src/gen/node_perfctr_provider.rc',
'src/gen/MSG00001.BIN',
'tools/msvs/genfiles/node_perfctr_provider.h',
'tools/msvs/genfiles/node_perfctr_provider.rc',
'tools/msvs/genfiles/MSG00001.BIN',
],
'action': [ 'ctrpp <@(_inputs) '
'-o src/gen/node_perfctr_provider.h '
'-rc src/gen/node_perfctr_provider.rc'
'-o tools/msvs/genfiles/node_perfctr_provider.h '
'-rc tools/msvs/genfiles/node_perfctr_provider.rc'
]
},
],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletions vcbuild.bat
Expand Up @@ -85,10 +85,13 @@ if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=
if defined noprojgen goto msbuild

@rem Generate the VS project.
python configure %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch%
if errorlevel 1 goto create-msvs-files-failed
if not exist node.sln goto create-msvs-files-failed
echo Project files generated.
SETLOCAL
if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat"
python configure %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch%
if errorlevel 1 goto create-msvs-files-failed
if not exist node.sln goto create-msvs-files-failed
echo Project files generated.
ENDLOCAL

:msbuild
@rem Skip project generation if requested.
Expand Down

0 comments on commit a616774

Please sign in to comment.