Skip to content
This repository

Windows build: support vs2012, fix shared #677

Closed
wants to merge 1 commit into from

3 participants

Luigi Grilli Ben Noordhuis Saúl Ibarra Corretgé
Luigi Grilli

Added support for Visual Studio 2012(updated gyp to the latest available
version)
Fixed shared build on windows (run-tests was failing)

Luigi Grilli Windows build: support vs2012, fix shared
Added support for Visual Studio 2012(updated gyp to the latest available
version)
Fixed shared build on windows (run-tests was failing)
36fd05e
Luigi Grilli gigi81 referenced this pull request in txdv/LibuvSharp January 05, 2013
Open

What is the status of LibuvSharp? #2

Ben Noordhuis bnoordhuis commented on the diff January 05, 2013
@@ -353,6 +353,51 @@
353 353
             '_XOPEN_SOURCE=500',
354 354
           ],
355 355
         }],
  356
+        ['OS=="win" and library=="shared_library"', {
4

Why is this section necessary?

Luigi Grilli
gigi81 added a note January 06, 2013

Without that section when building the shared(dll) version of the library you get this error:

test-spawn.obj : error LNK2019: unresolved external symbol _uv_utf8_to_utf16 referenced in function _run_test_environment_creation [C:\Users\Luigi\Documents\GitHub\libuv\run-tests.vcxproj]
test-spawn.obj : error LNK2019: unresolved external symbol _make_program_args referenced in function _run_test_argument_escaping [C:\Users\Luigi\Documents\GitHub\libuv\run-tests.vcxproj]
test-spawn.obj : error LNK2019: unresolved external symbol _quote_cmd_arg referenced in function _run_test_argument_escaping [C:\Users\Luigi\Documents\GitHub\libuv\run-tests.vcxproj]
test-spawn.obj : error LNK2019: unresolved external symbol _make_program_env referenced in function _run_test_environment_creation [C:\Users\Luigi\Documents\GitHub\libuv\run-tests.vcxproj]

Isn't that a matter of fixing the sources list in the normal OS=="win" section? This seems like a rather massive duplication.

Luigi Grilli
gigi81 added a note January 06, 2013

It's the cleanest solution I can think of.
This section is only needed when building the dll on windows. Other solution would involve to change multiple sections that don't actually need this change. The change is a single block (that can be easily removed if the future if not needed anymore) so I think it's really clean.
As long as the test program is using library staff that is not exported by the library (because not needed) this change is required to make the build work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Luigi Grilli

@bnoordhuis any update? planning to merge this? at lest merge the bat file. even if the dll build will be left broken at least we have a build on vs2012

Ben Noordhuis

@piscisaureus should review it (he works on the Windows side the most) but he's rather busy.

Saúl Ibarra Corretgé
Collaborator

VS2012 support already landed long ago, please one a new pull request if there is anything else to be fixed there, thanks!

Saúl Ibarra Corretgé saghul closed this September 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 05, 2013
Luigi Grilli Windows build: support vs2012, fix shared
Added support for Visual Studio 2012(updated gyp to the latest available
version)
Fixed shared build on windows (run-tests was failing)
36fd05e
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 93 additions and 8 deletions. Show diff stats Hide diff stats

  1. 45  uv.gyp
  2. 56  vcbuild.bat
45  uv.gyp
@@ -353,6 +353,51 @@
353 353
             '_XOPEN_SOURCE=500',
354 354
           ],
355 355
         }],
  356
+        ['OS=="win" and library=="shared_library"', {
  357
+          'sources': [
  358
+            'include/uv-private/uv-win.h',
  359
+			'src/uv-common.c',
  360
+			'src/fs-poll.c',
  361
+			'src/inet.c',
  362
+            'src/win/async.c',
  363
+            'src/win/atomicops-inl.h',
  364
+            'src/win/core.c',
  365
+            'src/win/dl.c',
  366
+            'src/win/error.c',
  367
+            'src/win/fs.c',
  368
+            'src/win/fs-event.c',
  369
+            'src/win/getaddrinfo.c',
  370
+            'src/win/handle.c',
  371
+            'src/win/handle-inl.h',
  372
+            'src/win/internal.h',
  373
+            'src/win/loop-watcher.c',
  374
+            'src/win/pipe.c',
  375
+            'src/win/thread.c',
  376
+            'src/win/poll.c',
  377
+            'src/win/process.c',
  378
+            'src/win/process-stdio.c',
  379
+            'src/win/req.c',
  380
+            'src/win/req-inl.h',
  381
+            'src/win/signal.c',
  382
+            'src/win/stream.c',
  383
+            'src/win/stream-inl.h',
  384
+            'src/win/tcp.c',
  385
+            'src/win/tty.c',
  386
+            'src/win/threadpool.c',
  387
+            'src/win/timer.c',
  388
+            'src/win/udp.c',
  389
+            'src/win/util.c',
  390
+            'src/win/winapi.c',
  391
+            'src/win/winapi.h',
  392
+            'src/win/winsock.c',
  393
+            'src/win/winsock.h',
  394
+		  ],
  395
+          'include_dirs': [
  396
+            'include',
  397
+            'include/uv-private',
  398
+            'src/',
  399
+          ],
  400
+        }],
356 401
       ],
357 402
       'msvs-settings': {
358 403
         'VCLinkerTool': {
56  vcbuild.bat
@@ -24,6 +24,12 @@ set library=static_library
24 24
 
25 25
 :next-arg
26 26
 if "%1"=="" goto args-done
  27
+
  28
+if "%1"=="help"		goto help
  29
+if "%1"=="/?"		goto help
  30
+if "%1"=="-h"		goto help
  31
+if "%1"=="--help"	goto help
  32
+
27 33
 if /i "%1"=="debug"        set config=Debug&goto arg-ok
28 34
 if /i "%1"=="release"      set config=Release&goto arg-ok
29 35
 if /i "%1"=="test"         set run=run-tests.exe&goto arg-ok
@@ -41,21 +47,42 @@ shift
41 47
 goto next-arg
42 48
 :args-done
43 49
 
  50
+@rem Find a Visual Studio version
  51
+@rem If multiple versions are installed on the system the lookup order is: 2010, 2008, 2012
  52
+
  53
+@rem You can force a specific Visual Studio version uncommenting the following line
  54
+@rem and changing the version to the one to force
  55
+@rem goto vc-set-2012
  56
+
  57
+:vc-set-2010
44 58
 @rem Look for Visual Studio 2010
45 59
 if not defined VS100COMNTOOLS goto vc-set-2008
46 60
 if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2008
47 61
 call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
  62
+echo Visul Studio 2010 found
48 63
 set GYP_MSVS_VERSION=2010
49 64
 goto select-target
50 65
 
51 66
 :vc-set-2008
52 67
 @rem Look for Visual Studio 2008
53  
-if not defined VS90COMNTOOLS goto vc-set-notfound
54  
-if not exist "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-notfound
  68
+if not defined VS90COMNTOOLS goto vc-set-2012
  69
+if not exist "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
55 70
 call "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
  71
+echo Visul Studio 2008 found
56 72
 set GYP_MSVS_VERSION=2008
57 73
 goto select-target
58 74
 
  75
+:vc-set-2012
  76
+@rem Look for Visual Studio 2012
  77
+if not defined VS110COMNTOOLS goto vc-set-notfound
  78
+if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-notfound
  79
+call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
  80
+@rem Using Visual Studio 2010 project format until the gyp version linked to
  81
+@rem the project will support Visual Studio 2012
  82
+echo Visul Studio 2012 found
  83
+set GYP_MSVS_VERSION=2012
  84
+goto select-target
  85
+
59 86
 :vc-set-notfound
60 87
 echo Warning: Visual Studio not found
61 88
 
@@ -71,8 +98,9 @@ if defined noprojgen goto msbuild
71 98
 
72 99
 @rem Generate the VS project.
73 100
 if exist build\gyp goto have_gyp
74  
-echo svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
75  
-svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
  101
+@rem used to be 983
  102
+echo svn co http://gyp.googlecode.com/svn/trunk@1556 build/gyp
  103
+svn co http://gyp.googlecode.com/svn/trunk@1556 build/gyp
76 104
 if errorlevel 1 goto gyp_install_failed
77 105
 goto have_gyp
78 106
 
@@ -117,11 +145,23 @@ echo Failed to create vc project files.
117 145
 goto exit
118 146
 
119 147
 :help
120  
-echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [x86/x64] [static/shared]
  148
+echo Usage: vcbuild [option(s)]
  149
+echo.
  150
+echo Available options:
  151
+echo     [debug/release]
  152
+echo     [test/bench]
  153
+echo     [clean]
  154
+echo     [noprojgen]
  155
+echo     [nobuild]
  156
+echo     [x86/x64]
  157
+echo     [static/shared]
  158
+echo.
121 159
 echo Examples:
122  
-echo   vcbuild.bat              : builds debug build
123  
-echo   vcbuild.bat test         : builds debug build and runs tests
124  
-echo   vcbuild.bat release bench: builds release build and runs benchmarks
  160
+echo   vcbuild                : builds static debug build
  161
+echo   vcbuild test           : builds static debug build and runs tests
  162
+echo   vcbuild release bench  : builds static release build and runs benchmarks
  163
+echo   vcbuild release shared : builds dll release build
  164
+
125 165
 goto exit
126 166
 
127 167
 :exit
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.