[Rcpp-commits] r4213 - in pkg/Rcpp: . R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 15 15:05:12 CET 2013


Author: jjallaire
Date: 2013-01-15 15:05:12 +0100 (Tue, 15 Jan 2013)
New Revision: 4213

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/R/Attributes.R
   pkg/Rcpp/inst/NEWS.Rd
Log:
don't add source directory as an include path for sourceCpp; fix duplicate inclusion of Rcpp directory

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-01-15 13:36:30 UTC (rev 4212)
+++ pkg/Rcpp/ChangeLog	2013-01-15 14:05:12 UTC (rev 4213)
@@ -1,6 +1,8 @@
 2014-01-15  JJ Allaire <jj at rstudio.org>
 
-        ** R/RcppLdpath.R: don't quote paths on windows
+        * R/Attributes.R: don't add source directory as an include path for
+        sourceCpp; fix duplicate inclusion of Rcpp directory
+        * R/RcppLdpath.R: don't quote paths on windows
 
 2014-01-14  JJ Allaire <jj at rstudio.org>
 

Modified: pkg/Rcpp/R/Attributes.R
===================================================================
--- pkg/Rcpp/R/Attributes.R	2013-01-15 13:36:30 UTC (rev 4212)
+++ pkg/Rcpp/R/Attributes.R	2013-01-15 14:05:12 UTC (rev 4213)
@@ -507,22 +507,19 @@
     
     # set CLINK_CPPFLAGS based on the LinkingTo dependencies
     buildEnv$CLINK_CPPFLAGS <- .buildClinkCppFlags(linkingToPackages)
-    
-    # add source file's directory to the compilation
-    srcDir <- asBuildPath(dirname(sourceFile))
-    buildEnv$CLINK_CPPFLAGS <- paste(buildEnv$CLINK_CPPFLAGS, 
-                                     paste0('-I"', srcDir, '"'), 
-                                     collapse=" ")
-    
-    # if the source file is in a package then add inst/include
+     
+    # if the source file is in a package then add src and inst/include
     if (.isPackageSourceFile(sourceFile)) {
+        srcDir <- dirname(sourceFile)
+        srcDir <- asBuildPath(srcDir)
         incDir <- file.path(dirname(sourceFile), "..", "inst", "include")
         incDir <- asBuildPath(incDir)
+        dirFlags <- paste0('-I"', c(srcDir, incDir), '"', collapse=" ")
         buildEnv$CLINK_CPPFLAGS <- paste(buildEnv$CLINK_CPPFLAGS, 
-                                         paste0('-I"', incDir, '"'), 
+                                         dirFlags, 
                                          collapse=" ")
     }
-
+    
     # add cygwin message muffler
     buildEnv$CYGWIN = "nodosfilewarning"
     

Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2013-01-15 13:36:30 UTC (rev 4212)
+++ pkg/Rcpp/inst/NEWS.Rd	2013-01-15 14:05:12 UTC (rev 4213)
@@ -12,8 +12,6 @@
     }
     \item Changes in Rcpp attributes: 
     \itemize{
-        \item Add the directory containing the target file as an
-        include directory for \code{sourceCpp} compilations.
         \item Added \code{Rcpp::plugins} attribute for binding 
         directly to inline plugins. Plugins can be registered using
         the new \code{registerPlugin} function.



More information about the Rcpp-commits mailing list