Added class_path option
3 files changed, 13 insertions(+), 2 deletions(-)

M src/meson.build
M src/meson_options.txt
M wofi_jni/src/wofi_jni.c
M src/meson.build +5 -0
@@ 5,8 5,13 @@ wofi = dependency('wofi')
 
 java_home = get_option('jdk_home')
 mode_class = get_option('mode_class')
+class_path = get_option('class_path')
 add_project_arguments('-DMODE_CLASS="' + mode_class + '"', language : 'c')
 
+if class_path != ''
+	add_project_arguments('-DCLASS_PATH="' + class_path + '"', language : 'c')
+endif
+
 jvm = cc.find_library('jvm', dirs : [java_home + '/lib/j9vm', java_home + '/lib/server'])
 
 jsrcdir = 'ninja/scoopta/software/wofij'

          
M src/meson_options.txt +2 -1
@@ 1,2 1,3 @@ 
 option('jdk_home', type : 'string', description : 'The path to the jdk install folder')
-option('mode_class', type : 'string', description : 'The class that implements mode')
  No newline at end of file
+option('mode_class', type : 'string', description : 'The class that implements mode')
+option('class_path', type : 'string', description : 'The class path to use, defaults to the path of the DSO determined at runtime, primarily used for debugging')
  No newline at end of file

          
M wofi_jni/src/wofi_jni.c +6 -1
@@ 154,7 154,12 @@ void load(struct mode* _mode) {
 	JavaVM* jvm;
 	JavaVMInitArgs args;
 	JavaVMOption options[1];
-	options[0].optionString = utils_concat(2, "-Djava.class.path=", wofi_get_dso_path(mode));
+#ifdef CLASS_PATH
+	char* cp = CLASS_PATH;
+#else
+	char* cp = wofi_get_dso_path(mode);
+#endif
+	options[0].optionString = utils_concat(2, "-Djava.class.path=", cp);
 	args.version = JNI_VERSION_10;
 	args.nOptions = 1;
 	args.options = options;