diff --git a/setup/setup_build_extension.py b/setup/setup_build_extension.py index f956c08f8..7fe904f65 100644 --- a/setup/setup_build_extension.py +++ b/setup/setup_build_extension.py @@ -90,7 +90,7 @@ def build_extensions(self): self.define = _build_clib.build_flags['define'] lib_dir = build_flags(LIB_NAME, 'L', pkg_dir)[0] - link_args_msvc = f'/LIBPATH:{lib_dir}' + link_args_msvc = '/LIBPATH:' + lib_dir.replace("/", "\\") for _l in build_flags(LIB_NAME, 'l', pkg_dir): lib_file, lib_fp = exact_library_name(_l, lib_dir) @@ -101,8 +101,10 @@ def build_extensions(self): self.extensions[0].extra_link_args.append(lib_fp) if compiler == 'MSVCCompiler': - self.extensions[0].extra_compile_args.append('/MT') + self.extensions[0].extra_compile_args.insert(0, '/MT') self.extensions[0].extra_link_args.insert(0, link_args_msvc) + self.extensions[0].extra_link_args.append(" /verbose:lib") + log.info(f'build_extensions: MSVCCompiler: {link_args_msvc}') super().build_extensions()