Skip to content

Commit

Permalink
Invoke POSTLINK script in mkmf to support codesign on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
ianks committed Sep 12, 2024
1 parent 086d3a2 commit 28c8f64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/rust_reverse/ext/rust_reverse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ crate-type = ["cdylib"]
default = ["stable-api-compiled-testing"]
test-feature = []
stable-api-compiled-testing = ["rb-sys/stable-api-compiled-testing"]

[profile.release]
debug = true
2 changes: 2 additions & 0 deletions gem/lib/rb_sys/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def create_rust_makefile(target, &blk)
RUSTLIBDIR = $(RB_SYS_FULL_TARGET_DIR)/$(RB_SYS_CARGO_PROFILE_DIR)
RUSTLIB = $(RUSTLIBDIR)/$(SOEXT_PREFIX)$(TARGET_NAME).$(SOEXT)
TIMESTAMP_DIR = .
POSTLINK = #{RbConfig::CONFIG["POSTLINK"] || "$(ECHO) skipping postlink (not found)"}
CLEANOBJS = $(RUSTLIBDIR) $(RB_SYS_BUILD_DIR)
CLEANLIBS = $(DLLIB) $(RUSTLIB)
Expand Down Expand Up @@ -132,6 +133,7 @@ def create_rust_makefile(target, &blk)
$(DLLIB): $(RUSTLIB)
\t$(Q) $(COPY) "$(RUSTLIB)" $@
\t$(Q) $(POSTLINK)
install-so: $(DLLIB) #{timestamp_file("sitearchdir")}
\t$(ECHO) installing $(DLLIB) to $(RUBYARCHDIR)
Expand Down

0 comments on commit 28c8f64

Please sign in to comment.