compiler: use -lpthread during building v itself.

pull/4987/head
Delyan Angelov 2020-05-22 08:36:56 +03:00
parent 27644333a8
commit 7a4f26ac4f
4 changed files with 9 additions and 2 deletions

View File

@ -292,7 +292,7 @@ jobs:
- name: v.c can be compiled and run
run: |
./v -os cross -o /tmp/v.c cmd/v
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
ls -lart v_from_vc
./v_from_vc version
- name: v_win.c can be compiled and run

View File

@ -48,7 +48,7 @@ ifdef WIN32
$(CC) $(CFLAGS) -g -std=c99 -municode -w -o v.exe $(TMPVC)/$(VCFILE) $(LDFLAGS)
./v.exe self
else
$(CC) $(CFLAGS) -g -std=gnu11 -w -o v $(TMPVC)/$(VCFILE) $(LDFLAGS) -lm
$(CC) $(CFLAGS) -g -std=gnu11 -w -o v $(TMPVC)/$(VCFILE) $(LDFLAGS) -lm -lpthread
ifdef ANDROID
chmod 755 v
endif

View File

@ -3,6 +3,8 @@
// that can be found in the LICENSE file.
module sync
#flag -lpthread
// [init_with=new_mutex] // TODO: implement support for this struct attribute, and disallow Mutex{} from outside the sync.new_mutex() function.
[ref_only]
pub struct Mutex {

View File

@ -192,6 +192,11 @@ pub fn parse_files(paths []string, table &table.Table, pref &pref.Preferences, g
return q.parsed_ast_files
}
}
if false {
// TODO: remove this; it just prevents warnings about unused time and runtime
time.sleep_ms(1)
println(runtime.nr_cpus())
}
// ///////////////
mut files := []ast.File{}
for path in paths {