Skip to content

Commit

Permalink
Drop lib prefix on win32 + unencap
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Dec 12, 2024
1 parent 65bb08b commit ee3e06b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ add_library(sbcl_librarian SHARED sbcl_librarian.c sbcl_librarian.h sbcl_librari
target_link_directories(sbcl_librarian PRIVATE $ENV{BUILD_PREFIX}/lib)
target_link_libraries(sbcl_librarian PUBLIC sbcl)

if(WIN32)
set_target_properties(sbcl_librarian PROPERTIES PREFIX "")
endif(WIN32)

add_custom_command(
OUTPUT sbcl_librarian.c sbcl_librarian.h
COMMAND ${CMAKE_COMMAND} -E env CL_SOURCE_REGISTRY=${CMAKE_CURRENT_SOURCE_DIR}/..// sh $ENV{SBCL_SRC}/run-sbcl.sh --script ${CMAKE_CURRENT_SOURCE_DIR}/generate-bindings.lisp
Expand Down
8 changes: 6 additions & 2 deletions lib/generate-bindings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@
#+win32
(sb-int:encapsulate
'sb-alien::find-dynamic-foreign-symbol-address
'find-libsbcl-librarian
'load-libsbcl-librarian
(lambda (orig-find symbol)
(load-shared-object "libsbcl_librarian.dll")
(funcall orig-find symbol)))
(unwind-protect
(funcall orig-find symbol)
(sb-int:unencapsulate
'sb-alien::find-dynamic-foreign-symbol-address
'load-libsbcl-librarian))))

(build-bindings sbcl-librarian "." :omit-init-function t)
(build-python-bindings sbcl-librarian "." :omit-init-call t :write-python-header-fn #'write-python-header)
Expand Down

0 comments on commit ee3e06b

Please sign in to comment.