File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ def sys(cmd)
15
15
ret
16
16
end
17
17
18
+ def windows?
19
+ RbConfig ::CONFIG [ 'host_os' ] =~ /mswin|mingw/
20
+ end
21
+
18
22
if !( MAKE = find_executable ( 'gmake' ) || find_executable ( 'make' ) )
19
23
abort "ERROR: GNU make is required to build Rugged."
20
24
end
@@ -55,7 +59,7 @@ def sys(cmd)
55
59
abort "ERROR: CMake is required to build Rugged."
56
60
end
57
61
58
- if !find_executable ( 'pkg-config' )
62
+ if !windows? && ! find_executable ( 'pkg-config' )
59
63
abort "ERROR: pkg-config is required to build Rugged."
60
64
end
61
65
@@ -66,8 +70,16 @@ def sys(cmd)
66
70
sys ( "cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G \" Unix Makefiles\" " )
67
71
sys ( MAKE )
68
72
69
- pcfile = File . join ( LIBGIT2_DIR , "build" , "libgit2.pc" )
70
- $LDFLAGS << " " + `pkg-config --libs --static #{ pcfile } ` . strip
73
+ # "normal" libraries (and libgit2 builds) get all these when they build but we're doing it
74
+ # statically so we put the libraries in by hand. It's important that we put the libraries themselves
75
+ # in $LIBS or the final linking stage won't pick them up
76
+ if windows?
77
+ $LDFLAGS << " " + "-L#{ Dir . pwd } /deps/winhttp"
78
+ $LIBS << " -lwinhttp -lcrypt32 -lrpcrt4 -lole32"
79
+ else
80
+ pcfile = File . join ( LIBGIT2_DIR , "build" , "libgit2.pc" )
81
+ $LDFLAGS << " " + `pkg-config --libs --static #{ pcfile } ` . strip
82
+ end
71
83
end
72
84
end
73
85
You can’t perform that action at this time.
0 commit comments