@@ -47,8 +47,8 @@ impl Build {
47
47
self
48
48
}
49
49
50
- pub fn lua52compat ( & mut self , status : bool ) -> & mut Build {
51
- self . options . lua52compat = status ;
50
+ pub fn lua52compat ( & mut self , enabled : bool ) -> & mut Build {
51
+ self . options . lua52compat = enabled ;
52
52
self
53
53
}
54
54
@@ -145,8 +145,9 @@ impl Build {
145
145
pub fn build_msvc ( & mut self ) -> Artifacts {
146
146
let target = & self . target . as_ref ( ) . expect ( "TARGET not set" ) [ ..] ;
147
147
let out_dir = self . out_dir . as_ref ( ) . expect ( "OUT_DIR not set" ) ;
148
- let source_dir = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "luajit2" ) ;
149
- let extras_dir = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "extras" ) ;
148
+ let manifest_dir = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
149
+ let source_dir = manifest_dir. join ( "luajit2" ) ;
150
+ let extras_dir = manifest_dir. join ( "extras" ) ;
150
151
let build_dir = out_dir. join ( "build" ) ;
151
152
let lib_dir = out_dir. join ( "lib" ) ;
152
153
let include_dir = out_dir. join ( "include" ) ;
@@ -160,16 +161,16 @@ impl Build {
160
161
. unwrap_or_else ( |e| panic ! ( "cannot create {}: {}" , dir. display( ) , e) ) ;
161
162
}
162
163
cp_r ( & source_dir, & build_dir) ;
163
- cp_r ( & extras_dir, & build_dir. join ( "src" ) ) ;
164
164
165
165
let mut msvcbuild = Command :: new ( build_dir. join ( "src" ) . join ( "msvcbuild.bat" ) ) ;
166
166
msvcbuild. current_dir ( build_dir. join ( "src" ) ) ;
167
167
if self . options . lua52compat {
168
+ cp_r ( & extras_dir, & build_dir. join ( "src" ) ) ;
168
169
msvcbuild. arg ( "lua52c" ) ;
169
170
}
170
171
msvcbuild. arg ( "static" ) ;
171
172
172
- let cl = cc:: windows_registry:: find_tool ( & target, "cl.exe" ) . expect ( "failed to find cl" ) ;
173
+ let cl = cc:: windows_registry:: find_tool ( target, "cl.exe" ) . expect ( "failed to find cl" ) ;
173
174
for ( k, v) in cl. env ( ) {
174
175
msvcbuild. env ( k, v) ;
175
176
}
0 commit comments