浏览代码

[java/cs] Renamed -javac-arg / -csc-arg to -c-arg. Closes #3768

Cauê Waneck 10 年之前
父节点
当前提交
87a589bcc3
共有 4 个文件被更改,包括 8 次插入22 次删除
  1. 2 4
      common.ml
  2. 1 8
      gencommon.ml
  3. 2 4
      interp.ml
  4. 3 6
      main.ml

+ 2 - 4
common.ml

@@ -150,8 +150,7 @@ type context = {
 	mutable net_libs : (string * bool * (unit -> path list) * (path -> IlData.ilclass option)) list; (* (path,std,all_files,lookup) *)
 	mutable net_libs : (string * bool * (unit -> path list) * (path -> IlData.ilclass option)) list; (* (path,std,all_files,lookup) *)
 	mutable net_std : string list;
 	mutable net_std : string list;
 	net_path_map : (path,string list * string list * string) Hashtbl.t;
 	net_path_map : (path,string list * string list * string) Hashtbl.t;
-	mutable javac_args : string list;
-	mutable csc_args : string list;
+	mutable c_args : string list;
 	mutable js_gen : (unit -> unit) option;
 	mutable js_gen : (unit -> unit) option;
 	(* typing *)
 	(* typing *)
 	mutable basic : basic_types;
 	mutable basic : basic_types;
@@ -710,8 +709,7 @@ let create v args =
 		net_libs = [];
 		net_libs = [];
 		net_std = [];
 		net_std = [];
 		net_path_map = Hashtbl.create 0;
 		net_path_map = Hashtbl.create 0;
-		javac_args = [];
-		csc_args = [];
+		c_args = [];
 		neko_libs = [];
 		neko_libs = [];
 		php_prefix = None;
 		php_prefix = None;
 		js_gen = None;
 		js_gen = None;

+ 1 - 8
gencommon.ml

@@ -1082,14 +1082,7 @@ let dump_descriptor gen name path_s module_s =
 		) gen.gcon.net_libs;
 		) gen.gcon.net_libs;
 	SourceWriter.write w "end libs";
 	SourceWriter.write w "end libs";
 	SourceWriter.newline w;
 	SourceWriter.newline w;
-	let args = match gen.gcon.platform with
-		| Java ->
-			gen.gcon.javac_args
-		| Cs ->
-			gen.gcon.csc_args
-		| _ ->
-			[]
-	in
+	let args = gen.gcon.c_args in
 	if args <> [] then begin
 	if args <> [] then begin
 		SourceWriter.write w "begin opts";
 		SourceWriter.write w "begin opts";
 		SourceWriter.newline w;
 		SourceWriter.newline w;

+ 2 - 4
interp.ml

@@ -2552,10 +2552,8 @@ let macro_lib =
 			| VString arg ->
 			| VString arg ->
 				let com = ccom() in
 				let com = ccom() in
 				(match com.platform with
 				(match com.platform with
-				| Java ->
-					com.javac_args <- arg :: com.javac_args
-				| Cs ->
-					com.csc_args <- arg :: com.csc_args
+				| Java | Cs | Cpp ->
+					com.c_args <- arg :: com.c_args
 				| _ -> failwith "Unsupported platform");
 				| _ -> failwith "Unsupported platform");
 				VNull
 				VNull
 			| _ ->
 			| _ ->

+ 3 - 6
main.ml

@@ -1139,12 +1139,9 @@ try
 		("-net-std",Arg.String (fun file ->
 		("-net-std",Arg.String (fun file ->
 			Gencs.add_net_std com file
 			Gencs.add_net_std com file
 		),"<file> : add a root std .NET DLL search path");
 		),"<file> : add a root std .NET DLL search path");
-		("-javac-arg",Arg.String (fun arg ->
-			com.javac_args <- arg :: com.javac_args
-		),"<arg> : pass argument <arg> to the Java compiler");
-		("-csc-arg",Arg.String (fun arg ->
-			com.csc_args <- arg :: com.csc_args
-		),"<arg> : pass option <arg> to the C# compiler");
+		("-c-arg",Arg.String (fun arg ->
+			com.c_args <- arg :: com.c_args
+		),"<arg> : pass option <arg> to the native Java/C# compiler");
 		("-x", Arg.String (fun file ->
 		("-x", Arg.String (fun file ->
 			let neko_file = file ^ ".n" in
 			let neko_file = file ^ ".n" in
 			set_platform Neko neko_file;
 			set_platform Neko neko_file;