Skip to content

Commit

Permalink
(dbg) linking static ?
Browse files Browse the repository at this point in the history
  • Loading branch information
MementoRC committed Jan 28, 2024
1 parent 725b473 commit d36dca3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions setup/setup_build_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,21 @@ def build_extensions(self):
self.extensions[0].include_dirs.extend(build_flags(LIB_NAME, 'I', pkg_dir))
self.define = _build_clib.build_flags['define']

lib_dir = build_flags(LIB_NAME, 'L', pkg_dir)
lib_file, lib_fp = exact_library_name(build_flags(LIB_NAME, 'l', pkg_dir)[0], lib_dir[0])
lib_dir = build_flags(LIB_NAME, 'L', pkg_dir)[0]
link_args_msvc = f'/LIBPATH:{lib_dir}'

for _l in build_flags(LIB_NAME, 'l', pkg_dir):
lib_file, lib_fp = exact_library_name(_l, lib_dir)

if compiler == 'MSVCCompiler':
link_args_msvc += f' {lib_file}'
else:
self.extensions[0].extra_link_args.append(lib_fp)

if compiler == 'MSVCCompiler':
link_args = f'/LIBPATH:{lib_dir[0]} {lib_file}'
log.info(f'build_extensions: MSVCCompiler: {link_args}')
self.extensions[0].extra_link_args.insert(0, link_args)
else:
self.extensions[0].extra_link_args.append(lib_fp)
self.extensions[0].extra_compile_args.append("/MT")
self.extensions[0].extra_link_args.insert(0, link_args_msvc)
log.info(f'build_extensions: MSVCCompiler: {link_args_msvc}')

super().build_extensions()

Expand Down

0 comments on commit d36dca3

Please sign in to comment.