Skip to content

Commit

Permalink
(dbg) linking static ... difficult, though I got it to work few month…
Browse files Browse the repository at this point in the history
…s ago ... getting old is no fun
  • Loading branch information
MementoRC committed Jan 28, 2024
1 parent e7717d3 commit 9f6b385
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup/setup_build_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 9f6b385

Please sign in to comment.