[education/rkward] rkward/rbackend: Comments

Thomas Friedrichsmeier null at kde.org
Sat Apr 9 09:17:39 BST 2022


Git commit c4c836b353ccd25e9704e5a217957884150ce522 by Thomas Friedrichsmeier.
Committed on 09/04/2022 at 08:17.
Pushed by tfry into branch 'master'.

Comments

M  +4    -3    rkward/rbackend/CMakeLists.txt
M  +5    -0    rkward/rbackend/GenLibFile.py

https://invent.kde.org/education/rkward/commit/c4c836b353ccd25e9704e5a217957884150ce522

diff --git a/rkward/rbackend/CMakeLists.txt b/rkward/rbackend/CMakeLists.txt
index 1ef80dbb..823d68a6 100644
--- a/rkward/rbackend/CMakeLists.txt
+++ b/rkward/rbackend/CMakeLists.txt
@@ -51,12 +51,13 @@ IF(APPLE)
     ADD_CUSTOM_COMMAND(TARGET rkward.rbackend POST_BUILD
     COMMAND codesign -d --force --options runtime --verbose=4 -s - --entitlements "${CMAKE_CURRENT_SOURCE_DIR}/rkward.rbackend.entitlements" ${CMAKE_CURRENT_BINARY_DIR}/rkward.rbackend
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    COMMENT "Adding entitlment for rkward.rbackend to link to external R lib..."
-)
+    COMMENT "Adding entitlment for rkward.rbackend to link to external R lib...")
 ENDIF()
 IF(MSVC)
+# When compiling with MSVC, we have to create a .lib file for R.dll, first
 FIND_PACKAGE(Python3 COMPONENTS Interpreter REQUIRED)
-ADD_CUSTOM_TARGET(R_lib COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/GenLibFile.py ${LIBR_SO} ${CMAKE_BINARY_DIR} ${CMAKE_SYSTEM_PROCESSOR})
+ADD_CUSTOM_TARGET(R_lib COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/GenLibFile.py ${LIBR_SO} ${CMAKE_BINARY_DIR} ${CMAKE_SYSTEM_PROCESSOR}
+                        COMMENT "Generate .lib file for R.dll")
 ADD_DEPENDENCIES(rkward.rbackend R_lib)
 ENDIF(MSVC)
 
diff --git a/rkward/rbackend/GenLibFile.py b/rkward/rbackend/GenLibFile.py
index 5432282a..1ab87641 100644
--- a/rkward/rbackend/GenLibFile.py
+++ b/rkward/rbackend/GenLibFile.py
@@ -2,6 +2,11 @@ import subprocess
 import os
 import sys
 
+# Generate a .lib file for a given .dll
+# This assumed dumpbin and lib to be in the path, which they should be, when compiling with MSVC (and that's what this is needed for)
+#
+# Usage: python3 GenLibFile.py XYZ.dll output_directory architecture
+
 dllfile = sys.argv[1]
 workdir = sys.argv[2]
 arch = sys.argv[3]


More information about the rkward-tracker mailing list