Compile this source file

Property definitions

nitc :: on_demand_compiler $ ExternFile :: compile
	# Compile this source file
	private fun compile(v: NaiveInterpreter, mmodule: MModule,
		object_files: Array[String], pkg_cflags: String): Bool is abstract
src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit:395,2--397,68

nitc :: on_demand_compiler $ ExternCFile :: compile
	redef fun compile(v, mmodule, object_files, pkg_cflags)
	do
		var compile_dir = v.compile_dir
		var cflags = mmodule.cflags[""].join(" ") + " " + pkg_cflags
		var obj = compile_dir / filename.basename(".c") + ".o"

		var cmd = "{v.c_compiler} -Wall -c -fPIC -I {compile_dir} -g -o {obj} {compile_dir / filename} {cflags}"
		if sys.system(cmd) != 0 then
			 v.fatal "FFI Error: Failed to compile C code using `{cmd}`"
			 return false
		end

		object_files.add obj
		return true
	end
src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit:401,2--415,4