cc.v: build_module mode fix

Create the modules directory if it's not there.
pull/1970/head
unknown-v 2019-09-13 19:47:17 +02:00 committed by Alexander Medvednikov
parent c614639e7b
commit 3dc4abddec
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ fn (v mut V) cc() {
v.out_name = v.out_name + '.so'
}
if v.pref.build_mode == .build_module {
// Create the modules directory if it's not there.
if !os.file_exists(ModPath) {
os.mkdir(ModPath)
}
v.out_name = ModPath + v.dir + '.o' //v.out_name
println('Building ${v.out_name}...')
}