nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Jwrapper: more clean up
[nit.git]
/
src
/
ffi
/
cpp.nit
diff --git
a/src/ffi/cpp.nit
b/src/ffi/cpp.nit
index
8ca389a
..
e114cd2
100644
(file)
--- a/
src/ffi/cpp.nit
+++ b/
src/ffi/cpp.nit
@@
-27,7
+27,7
@@
end
redef class MModule
private var cpp_file: nullable CPPCompilationUnit = null
redef class MModule
private var cpp_file: nullable CPPCompilationUnit = null
- var cpp_compiler_options = "" is writable
+ var cppflags = "" is writable
end
class CPPLanguage
end
class CPPLanguage
@@
-124,7
+124,7
@@
class CPPLanguage
# write .cpp and .hpp file
cpp_file.header_custom.add("extern \"C\" \{\n")
# write .cpp and .hpp file
cpp_file.header_custom.add("extern \"C\" \{\n")
- cpp_file.header_custom.add("#include \"{mmodule.name}._ffi.h\"\n")
+ cpp_file.header_custom.add("#include \"{mmodule.c_name}._ffi.h\"\n")
cpp_file.header_custom.add("\}\n")
var file = cpp_file.write_to_files(mmodule, compdir)
cpp_file.header_custom.add("\}\n")
var file = cpp_file.write_to_files(mmodule, compdir)
@@
-133,7
+133,7
@@
class CPPLanguage
mmodule.ffi_files.add(file)
# add linked option to support C++
mmodule.ffi_files.add(file)
# add linked option to support C++
- mmodule.c_linker_options = "{mmodule.c_linker_options} -lstdc++"
+ mmodule.ldflags = "{mmodule.ldflags} -lstdc++"
end
redef fun compile_callback(callback, mmodule, mainmodule, ecc)
end
redef fun compile_callback(callback, mmodule, mainmodule, ecc)
@@
-158,10
+158,10
@@
class CPPCompilationUnit
fun write_to_files(mmodule: MModule, compdir: String): ExternCppFile
do
fun write_to_files(mmodule: MModule, compdir: String): ExternCppFile
do
- var base_name = "{mmodule.name}._ffi"
+ var base_name = "{mmodule.c_name}._ffi"
var h_file = "{base_name}.hpp"
var h_file = "{base_name}.hpp"
- var guard = "{mmodule.cname.to_s.to_upper}_NIT_HPP"
+ var guard = "{mmodule.c_name.to_s.to_upper}_NIT_HPP"
write_header_to_file(mmodule, "{compdir}/{h_file}", new Array[String], guard)
write_header_to_file(mmodule, "{compdir}/{h_file}", new Array[String], guard)
@@
-180,7
+180,7
@@
class ExternCppFile
var mmodule: MModule
redef fun makefile_rule_name do return "{filename.basename("")}.o"
var mmodule: MModule
redef fun makefile_rule_name do return "{filename.basename("")}.o"
- redef fun makefile_rule_content do return "$(CXX) $(CFLAGS) {mmodule.cpp_compiler_options} -c {filename.basename("")} -o {filename.basename("")}.o"
+ redef fun makefile_rule_content do return "$(CXX) $(CFLAGS) {mmodule.cppflags} -c {filename.basename("")} -o {filename.basename("")}.o"
redef fun compiles_to_o_file do return true
end
redef fun compiles_to_o_file do return true
end