Browse Source

[jvm] add --java-lib-extern

closes #9515
Aleksandr Kuzmenko 5 years ago
parent
commit
c7e2b2f5b1
3 changed files with 5 additions and 1 deletions
  1. 1 0
      extra/CHANGES.txt
  2. 3 0
      src/compiler/haxe.ml
  3. 1 1
      src/generators/genjvm.ml

+ 1 - 0
extra/CHANGES.txt

@@ -4,6 +4,7 @@
 
 	all : fixed compilation server bug caused by removing `inline` from a method (#9690)
 	macro : fixed compiler crash if `@:genericBuild` meta is removed by a macro during building (#9391)
+	jvm : fixed "--java-lib-extern" (#9515)
 	flash : fixed var shadowing issue for variables captured in a closure inside of a loop (#9624)
 	flash : fixed `VerifyError` exception when `Void` end up as an argument type after inlining (#9678)
 	php : fixed runtime error "cannot use temporary expression in write context" for call arguments passed by reference

+ 3 - 0
src/compiler/haxe.ml

@@ -856,6 +856,9 @@ try
 		("Target-specific",["--java-lib"],["-java-lib"],Arg.String (fun file ->
 			add_native_lib file false;
 		),"<file>","add an external JAR or class directory library");
+		("Target-specific",["--java-lib-extern"],["-java-lib-extern"],Arg.String (fun file ->
+			add_native_lib file true;
+		),"<file>","use an external JAR or class directory library for type checking");
 		("Target-specific",["--net-lib"],["-net-lib"],Arg.String (fun file ->
 			add_native_lib file false;
 		),"<file>[@std]","add an external .NET DLL file");

+ 1 - 1
src/generators/genjvm.ml

@@ -2841,7 +2841,7 @@ let generate jvm_flag com =
 	gctx.typedef_interfaces <- new typedef_interfaces anon_identification;
 	gctx.typedef_interfaces#add_interface_rewrite (["haxe";"root"],"Iterator") (["java";"util"],"Iterator") true;
 	let class_paths = ExtList.List.filter_map (fun java_lib ->
-		if java_lib#has_flag NativeLibraries.FlagIsStd then None
+		if java_lib#has_flag NativeLibraries.FlagIsStd || java_lib#has_flag FlagIsExtern then None
 		else begin
 			let dir = Printf.sprintf "%slib/" jar_dir in
 			Path.mkdir_from_path dir;