[Rcpp-commits] r4155 - in pkg/Rcpp: . R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 13 19:06:08 CET 2012


Author: jjallaire
Date: 2012-12-13 19:06:07 +0100 (Thu, 13 Dec 2012)
New Revision: 4155

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/R/Attributes.R
   pkg/Rcpp/src/attributes.cpp
Log:
always generate new dynlib file for rebuild=TRUE

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-12-13 18:01:39 UTC (rev 4154)
+++ pkg/Rcpp/ChangeLog	2012-12-13 18:06:07 UTC (rev 4155)
@@ -1,6 +1,8 @@
 2012-12-12  JJ Allaire <jj at rstudio.org>
 
-        * src/attributes.cpp: set svn:eol-style to native
+        * src/Attributes.R: always generate new dynlib file for rebuild=TRUE
+        * src/attributes.cpp: set svn:eol-style to native; always generate 
+        new dynlib file for rebuild=TRUE
 
 2012-12-12 Romain Francois <romain at r-enthusiasts.com>
 

Modified: pkg/Rcpp/R/Attributes.R
===================================================================
--- pkg/Rcpp/R/Attributes.R	2012-12-13 18:01:39 UTC (rev 4154)
+++ pkg/Rcpp/R/Attributes.R	2012-12-13 18:06:07 UTC (rev 4155)
@@ -36,7 +36,8 @@
     file <- normalizePath(file, winslash = "/")
      
     # get the context (does code generation as necessary)
-    context <- .Call("sourceCppContext", PACKAGE="Rcpp", file, code, .Platform)
+    context <- .Call("sourceCppContext", PACKAGE="Rcpp", 
+                     file, code, rebuild, .Platform)
     
     # perform a build if necessary
     if (context$buildRequired || rebuild) {

Modified: pkg/Rcpp/src/attributes.cpp
===================================================================
--- pkg/Rcpp/src/attributes.cpp	2012-12-13 18:01:39 UTC (rev 4154)
+++ pkg/Rcpp/src/attributes.cpp	2012-12-13 18:06:07 UTC (rev 4155)
@@ -2511,11 +2511,13 @@
 
 // Create temporary build directory, generate code as necessary, and return
 // the context required for the sourceCpp function to complete it's work
-RcppExport SEXP sourceCppContext(SEXP sFile, SEXP sCode, SEXP sPlatform) {
+RcppExport SEXP sourceCppContext(SEXP sFile, SEXP sCode, 
+                                 SEXP sRebuild, SEXP sPlatform) {
 BEGIN_RCPP
     // parameters
     std::string file = Rcpp::as<std::string>(sFile);
     std::string code = sCode != R_NilValue ? Rcpp::as<std::string>(sCode) : "";
+    bool rebuild = Rcpp::as<bool>(sRebuild);
     Rcpp::List platform = Rcpp::as<Rcpp::List>(sPlatform);
     
     // get dynlib (using cache if possible)
@@ -2537,7 +2539,7 @@
     }    
         
     // if the cached dynlib is dirty then regenerate the source
-    else if (pDynlib->isSourceDirty()) {
+    else if (rebuild || pDynlib->isSourceDirty()) {
         buildRequired = true;    
         pDynlib->regenerateSource();
     }



More information about the Rcpp-commits mailing list