# Compiler of the target program
var compiler: AbstractCompiler
- # Directory where to generate all C files
- fun compile_dir: String
+ # Directory where to generate all files
+ #
+ # The option `--compile_dir` change this directory.
+ fun root_compile_dir: String
do
var compile_dir = toolcontext.opt_compile_dir.value
if compile_dir == null then compile_dir = "nit_compile"
return compile_dir
end
+ # Directory where to generate all C files
+ #
+ # By default it is `root_compile_dir` but some platform may require that it is a subdirectory.
+ fun compile_dir: String do return root_compile_dir
+
# Write all C files and compile them
fun write_and_make is abstract
end
var time0 = get_time
self.toolcontext.info("*** WRITING C ***", 1)
+ root_compile_dir.mkdir
compile_dir.mkdir
var cfiles = new Array[String]
redef fun compile_dir
do
- var android_project_root = "{super}/android/"
+ var android_project_root = "{root_compile_dir}/android/"
self.android_project_root = android_project_root
return "{android_project_root}/jni/nit_compile/"
end
end
toolcontext.exec_and_check(["ln", "-s", "{share_dir}/libgc/arm/include/gc/",
- "{android_project_root}/jni/nit_compile/gc"], "Android project error")
+ "{compile_dir}/gc"], "Android project error")
### Link to assets (for mnit and others)
# This will be accessed from `android_project_root`
# Compile C files in `ios_project_root/app_project.name`
redef fun compile_dir
do
- ios_project_root = super/"ios"
+ ios_project_root = root_compile_dir/"ios"
return ios_project_root/app_project.short_name
end