diff --git a/R/build.R b/R/build.R index ef71c0f..abc78a0 100644 --- a/R/build.R +++ b/R/build.R @@ -21,8 +21,11 @@ CxxFlags <- function() { #' @importFrom RProtoBufLib LdFlags #' @importFrom RcppParallel RcppParallelLibs cytolib_LdFlags <- function() { - cat(res <- asBuildPath(system.file("lib/libcytolib.a", package = "cytolib"))) -} + libDir <- "lib/" + if (.Platform$OS.type == "windows") + libDir <- paste(libDir, .Platform$r_arch, "/", sep="") + cat(asBuildPath(system.file(paste(libDir, "libcytolib.a", sep = ""), package = "cytolib"))) + } diff --git a/src/Makevars.in b/src/Makevars.in index e26fdd7..ccb461b 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -43,5 +43,5 @@ $(boost_fs_objs): ${boost_sys_objs} clean: - rm -f $(OBJECTS) ${boost_fs_objs} ${boost_sys_objs} $(SHLIB) + rm -f $(OBJECTS) ${cytolib_objs} ${boost_fs_objs} ${boost_sys_objs} $(SHLIB) diff --git a/src/Makevars.win b/src/Makevars.win index ad3f8aa..23d6ee2 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -14,6 +14,8 @@ boost_fs_src=${wildcard boost/libs/filesystem/src/*.cpp} boost_fs_objs=${boost_fs_src:.cpp=.o} PKG_CPPFLAGS =-DROUT -I../inst/include -DRCPP_PARALLEL_USE_TBB=1 -fpermissive -DBOOST_NO_AUTO_PTR +cytolib_src=${wildcard *.cpp} +cytolib_objs=${cytolib_src:.cpp=.o} #needs to wrap in $(shell) to strip the quotes returned by rhdf5lib::pkgconfig @@ -24,6 +26,7 @@ PKG_LIBS = ${boost_fs_objs} ${boost_sys_objs} $(LAPACK_LIBS) $(BLAS_LIBS) $(FLI USERDIR = ${R_PACKAGE_DIR}/lib${R_ARCH} PKGLIB = ${USERDIR}/libcytolib.a +OBJECTS=dummy.o all: $(SHLIB) @@ -34,7 +37,7 @@ $(SHLIB): $(PKGLIB) #expose static lib for other package to link to $(PKGLIB): $(OBJECTS) mkdir -p "${USERDIR}" - $(AR) rs "${PKGLIB}" $(OBJECTS) $(boost_fs_objs) ${boost_sys_objs} + $(AR) rs "${PKGLIB}" $(cytolib_objs) $(boost_fs_objs) ${boost_sys_objs} @@ -44,5 +47,4 @@ $(boost_fs_objs): ${boost_sys_objs} clean: - rm -f $(OBJECTS) ${boost_fs_objs} ${boost_sys_objs} - + rm -f $(OBJECTS) ${cytolib_objs} ${boost_fs_objs} ${boost_sys_objs} $(SHLIB)