Browse Source

forgot to get rid of 2 uselss things in init.c

master
boB Rudis 3 months ago
parent
commit
6b69126504
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
2 changed files with 19 additions and 7 deletions
  1. +19
    -4
      src/Makevars
  2. +0
    -3
      src/init.c

+ 19
- 4
src/Makevars View File

@ -3,20 +3,35 @@ INSTALL_NAME_TOOL = /usr/bin/install_name_tool
SWIFTLIB = libswiftspeech.dylib
LIBDIR = ../inst/lib
DEVLIB = ../lib
REQUIRED_ARGS = -I /Library/Frameworks/R.framework/Headers -F/Library/Frameworks -framework R -emit-library
# add any additional frameworks being used here
EXTRA_FRAMEWORKS = -framework CoreML -framework NaturalLanguage
# the main swift executable
SWIFT_SRC = swiftspeech.swift
# the bridging header which sets up R accessibility to Swift
BRIDGING_HEADER = -import-objc-header swiftspeech.h
# the package shared library (what you put in useDynLib())
PKG_DYNLIB = swiftspeech.so
# linker glue
PKG_LIBS = -lswiftspeech -L../inst/lib
all: $(SHLIB) swiftLibrary
swiftLibrary: $(SWIFTLIB)
# this is where the dylib will go for pkg installation
-@if test ! -e $(LIBDIR); then mkdir -p $(LIBDIR); fi
-@if test ! -e $(DEVLIB); then mkdir -p $(DEVLIB); fi
cp $(SWIFTLIB) $(LIBDIR)
# this is where the dylib will go during development
-@if test ! -e $(DEVLIB); then mkdir -p $(DEVLIB); fi
cp $(SWIFTLIB) $(DEVLIB)
$(SWIFTLIB): $(OBJECTS)
# comnpile packate "glue"
$(SHLIB_CXXLD) -o $(SWIFTLIB) $^ $(SHLIB_CXXLDFLAGS) $(LDFLAGS) $(ALL_LIBS)
$(SWIFTC) -I /Library/Frameworks/R.framework/Headers -F/Library/Frameworks -framework R -framework CoreML -framework NaturalLanguage -import-objc-header swiftspeech.h -emit-library swiftspeech.swift
$(INSTALL_NAME_TOOL) -change $(SWIFTLIB) @loader_path/../lib/$(SWIFTLIB) swiftspeech.so
# compile swift compoonents
$(SWIFTC) $(REQUIRED_ARGS) $(BRIDGING_HEADER) $(EXTRA_FRAMEWORKS) $(SWIFT_SRC)
# ensure R can find the dylib after installation
$(INSTALL_NAME_TOOL) -change $(SWIFTLIB) @loader_path/../lib/$(SWIFTLIB) $(PKG_DYNLIB)
clean:
rm -Rf $(SHLIB) $(SWIFTLIB) $(OBJECTS) $(DEVLIB)/$(SWIFTLIB)
rm -Rf $(SHLIB) $(SWIFTLIB) $(OBJECTS) $(DEVLIB)/$(SWIFTLIB)

+ 0
- 3
src/init.c View File

@ -3,9 +3,6 @@
#include <stdlib.h> // for NULL
#include <R_ext/Rdynload.h>
/* .Call calls */
extern SEXP hey();
extern SEXP plus_one(SEXP);
extern SEXP part_of_speech(SEXP);
static const R_CallMethodDef CallEntries[] = {


Loading…
Cancel
Save