mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
bootstrap: remove -I ./thirdparty/stdatomic/nix from make files (#14111)
This commit is contained in:
parent
960225f7a7
commit
31b28af179
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -429,7 +429,7 @@ jobs:
|
|||||||
- name: Test new v.c
|
- name: Test new v.c
|
||||||
run: |
|
run: |
|
||||||
.\v.exe -o v.c cmd/v
|
.\v.exe -o v.c cmd/v
|
||||||
gcc -Werror -I ./thirdparty/stdatomic/win -municode -w v.c
|
gcc -Werror -municode -w v.c
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
.\v.exe setup-freetype
|
.\v.exe setup-freetype
|
||||||
@ -534,7 +534,7 @@ jobs:
|
|||||||
- name: Test new v.c
|
- name: Test new v.c
|
||||||
run: |
|
run: |
|
||||||
.\v.exe -o v.c cmd/v
|
.\v.exe -o v.c cmd/v
|
||||||
.\thirdparty\tcc\tcc.exe -I ./thirdparty/stdatomic/win -Werror -w -ladvapi32 -bt10 v.c
|
.\thirdparty\tcc\tcc.exe -Werror -w -ladvapi32 -bt10 v.c
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
.\v.exe setup-freetype
|
.\v.exe setup-freetype
|
||||||
@ -575,7 +575,7 @@ jobs:
|
|||||||
## .\v.exe wipe-cache
|
## .\v.exe wipe-cache
|
||||||
## .\make.bat -tcc32
|
## .\make.bat -tcc32
|
||||||
## - name: Test new v.c
|
## - name: Test new v.c
|
||||||
## run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -I ./thirdparty/stdatomic/win -Werror -g -w -ladvapi32 -bt10 v.c
|
## run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -Werror -g -w -ladvapi32 -bt10 v.c
|
||||||
## - name: v doctor
|
## - name: v doctor
|
||||||
## run: ./v doctor
|
## run: ./v doctor
|
||||||
##
|
##
|
||||||
|
4
.github/workflows/ci_bootstrapping_works.yml
vendored
4
.github/workflows/ci_bootstrapping_works.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
VFLAGS: -cc tcc -no-retry-compilation
|
VFLAGS: -cc tcc -no-retry-compilation
|
||||||
B_CFLAGS: -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w
|
B_CFLAGS: -g -std=gnu11 -w
|
||||||
B_LFLAGS: -lm -lpthread
|
B_LFLAGS: -lm -lpthread
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -52,7 +52,7 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
VFLAGS: -cc clang
|
VFLAGS: -cc clang
|
||||||
B_CFLAGS: -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w
|
B_CFLAGS: -g -std=gnu11 -w
|
||||||
B_LFLAGS: -lm -lpthread
|
B_LFLAGS: -lm -lpthread
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
4
.github/workflows/ci_cross.yml
vendored
4
.github/workflows/ci_cross.yml
vendored
@ -71,14 +71,14 @@ jobs:
|
|||||||
- name: v.c can be compiled and run with -os cross
|
- name: v.c can be compiled and run with -os cross
|
||||||
run: |
|
run: |
|
||||||
./v -os cross -o /tmp/v.c cmd/v
|
./v -os cross -o /tmp/v.c cmd/v
|
||||||
gcc -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w -o v_from_vc /tmp/v.c -lm -lpthread
|
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
|
||||||
ls -lart v_from_vc
|
ls -lart v_from_vc
|
||||||
./v_from_vc version
|
./v_from_vc version
|
||||||
|
|
||||||
- name: v_win.c can be compiled and run with -os windows
|
- name: v_win.c can be compiled and run with -os windows
|
||||||
run: |
|
run: |
|
||||||
./v -cc msvc -os windows -o /tmp/v_win.c cmd/v
|
./v -cc msvc -os windows -o /tmp/v_win.c cmd/v
|
||||||
x86_64-w64-mingw32-gcc -I ./thirdparty/stdatomic/win /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
|
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
|
||||||
ls -lart v_from_vc.exe
|
ls -lart v_from_vc.exe
|
||||||
wine64 ./v_from_vc.exe version
|
wine64 ./v_from_vc.exe version
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
FROM mstorsjo/llvm-mingw
|
FROM mstorsjo/llvm-mingw
|
||||||
|
|
||||||
LABEL maintainer="Vitaly Takmazov <vitalyster@gmail.com>"
|
LABEL maintainer="Delyan Angelov <delian66@gmail.com>"
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN make
|
RUN make
|
||||||
RUN ./v -os windows -o v.c cmd/v
|
RUN ./v -os windows -o v.c cmd/v
|
||||||
RUN x86_64-w64-mingw32-gcc v.c -std=c99 -I ./thirdparty/stdatomic/win -w -municode -o v.exe
|
RUN x86_64-w64-mingw32-gcc v.c -std=c99 -w -municode -o v.exe
|
||||||
RUN file v.exe
|
RUN file v.exe
|
||||||
|
|
||||||
CMD [ "bash" ]
|
CMD [ "bash" ]
|
||||||
|
@ -84,13 +84,13 @@ endif
|
|||||||
|
|
||||||
all: latest_vc latest_tcc
|
all: latest_vc latest_tcc
|
||||||
ifdef WIN32
|
ifdef WIN32
|
||||||
$(CC) $(CFLAGS) -std=c99 -municode -w -I ./thirdparty/stdatomic/nix -o v1.exe $(VC)/$(VCFILE) $(LDFLAGS)
|
$(CC) $(CFLAGS) -std=c99 -municode -w -o v1.exe $(VC)/$(VCFILE) $(LDFLAGS)
|
||||||
v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
||||||
v2.exe -o $(V) $(VFLAGS) cmd/v
|
v2.exe -o $(V) $(VFLAGS) cmd/v
|
||||||
del v1.exe
|
del v1.exe
|
||||||
del v2.exe
|
del v2.exe
|
||||||
else
|
else
|
||||||
$(CC) $(CFLAGS) -std=gnu99 -w -I ./thirdparty/stdatomic/nix -o v1.exe $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS)
|
$(CC) $(CFLAGS) -std=gnu99 -w -o v1.exe $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS)
|
||||||
./v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
./v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
||||||
./v2.exe -o $(V) $(VFLAGS) cmd/v
|
./v2.exe -o $(V) $(VFLAGS) cmd/v
|
||||||
rm -rf v1.exe v2.exe
|
rm -rf v1.exe v2.exe
|
||||||
|
2
Makefile
2
Makefile
@ -6,7 +6,7 @@ LDFLAGS ?=
|
|||||||
all:
|
all:
|
||||||
rm -rf vc/
|
rm -rf vc/
|
||||||
git clone --depth 1 --quiet https://github.com/vlang/vc
|
git clone --depth 1 --quiet https://github.com/vlang/vc
|
||||||
$(CC) $(CFLAGS) -std=gnu11 -w -I ./thirdparty/stdatomic/nix -o v1 vc/v.c -lm -lexecinfo -lpthread $(LDFLAGS)
|
$(CC) $(CFLAGS) -std=gnu11 -w -o v1 vc/v.c -lm -lexecinfo -lpthread $(LDFLAGS)
|
||||||
./v1 -no-parallel -o v2 $(VFLAGS) cmd/v
|
./v1 -no-parallel -o v2 $(VFLAGS) cmd/v
|
||||||
./v2 -o v $(VFLAGS) cmd/v
|
./v2 -o v $(VFLAGS) cmd/v
|
||||||
rm -rf v1 v2 vc/
|
rm -rf v1 v2 vc/
|
||||||
|
@ -222,9 +222,8 @@ fn get_all_commands() []Command {
|
|||||||
rmfile: 'examples/tetris/tetris'
|
rmfile: 'examples/tetris/tetris'
|
||||||
}
|
}
|
||||||
$if macos || linux {
|
$if macos || linux {
|
||||||
ipath := '$vroot/thirdparty/stdatomic/nix'
|
|
||||||
res << Command{
|
res << Command{
|
||||||
line: '$vexe -o v.c cmd/v && cc -Werror -I ${os.quoted_path(ipath)} v.c -lpthread -lm && rm -rf a.out'
|
line: '$vexe -o v.c cmd/v && cc -Werror v.c -lpthread -lm && rm -rf a.out'
|
||||||
label: 'v.c should be buildable with no warnings...'
|
label: 'v.c should be buildable with no warnings...'
|
||||||
okmsg: 'v.c can be compiled without warnings. This is good :)'
|
okmsg: 'v.c can be compiled without warnings. This is good :)'
|
||||||
rmfile: 'v.c'
|
rmfile: 'v.c'
|
||||||
|
8
make.bat
8
make.bat
@ -119,7 +119,7 @@ REM By default, use tcc, since we have it prebuilt:
|
|||||||
:tcc_strap
|
:tcc_strap
|
||||||
:tcc32_strap
|
:tcc32_strap
|
||||||
echo ^> Attempting to build v_win.c with "!tcc_exe!"
|
echo ^> Attempting to build v_win.c with "!tcc_exe!"
|
||||||
"!tcc_exe!" -Bthirdparty/tcc -Ithirdparty/stdatomic/win -bt10 -g -w -o v.exe vc\v_win.c -ladvapi32
|
"!tcc_exe!" -Bthirdparty/tcc -bt10 -g -w -o v.exe vc\v_win.c -ladvapi32
|
||||||
if %ERRORLEVEL% NEQ 0 goto :compile_error
|
if %ERRORLEVEL% NEQ 0 goto :compile_error
|
||||||
echo ^> Compiling .\v.exe with itself
|
echo ^> Compiling .\v.exe with itself
|
||||||
v.exe -keepc -g -showcc -cc "!tcc_exe!" -cflags -Bthirdparty/tcc -o v2.exe cmd/v
|
v.exe -keepc -g -showcc -cc "!tcc_exe!" -cflags -Bthirdparty/tcc -o v2.exe cmd/v
|
||||||
@ -137,7 +137,7 @@ if %ERRORLEVEL% NEQ 0 (
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo ^> Attempting to build v_win.c with Clang
|
echo ^> Attempting to build v_win.c with Clang
|
||||||
clang -std=c99 -Ithirdparty/stdatomic/win -municode -g -w -o v.exe .\vc\v_win.c -ladvapi32
|
clang -std=c99 -municode -g -w -o v.exe .\vc\v_win.c -ladvapi32
|
||||||
if %ERRORLEVEL% NEQ 0 (
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
echo In most cases, compile errors happen because the version of Clang installed is too old
|
echo In most cases, compile errors happen because the version of Clang installed is too old
|
||||||
clang --version
|
clang --version
|
||||||
@ -160,7 +160,7 @@ if %ERRORLEVEL% NEQ 0 (
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo ^> Attempting to build v_win.c with GCC
|
echo ^> Attempting to build v_win.c with GCC
|
||||||
gcc -std=c99 -municode -Ithirdparty/stdatomic/win -g -w -o v.exe .\vc\v_win.c -ladvapi32
|
gcc -std=c99 -municode -g -w -o v.exe .\vc\v_win.c -ladvapi32
|
||||||
if %ERRORLEVEL% NEQ 0 (
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
echo In most cases, compile errors happen because the version of GCC installed is too old
|
echo In most cases, compile errors happen because the version of GCC installed is too old
|
||||||
gcc --version
|
gcc --version
|
||||||
@ -202,7 +202,7 @@ if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
|
|||||||
set ObjFile=.v.c.obj
|
set ObjFile=.v.c.obj
|
||||||
|
|
||||||
echo ^> Attempting to build v_win.c with MSVC
|
echo ^> Attempting to build v_win.c with MSVC
|
||||||
cl.exe /volatile:ms /I thirdparty\stdatomic\win /Fo%ObjFile% /O2 /MD /D_VBOOTSTRAP vc\v_win.c user32.lib kernel32.lib advapi32.lib shell32.lib /link /nologo /out:v.exe /incremental:no
|
cl.exe /volatile:ms /Fo%ObjFile% /O2 /MD /D_VBOOTSTRAP vc\v_win.c user32.lib kernel32.lib advapi32.lib shell32.lib /link /nologo /out:v.exe /incremental:no
|
||||||
if %ERRORLEVEL% NEQ 0 (
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
echo In some cases, compile errors happen because of the MSVC compiler version
|
echo In some cases, compile errors happen because of the MSVC compiler version
|
||||||
cl.exe
|
cl.exe
|
||||||
|
@ -5,8 +5,10 @@ module stdatomic
|
|||||||
|
|
||||||
$if windows {
|
$if windows {
|
||||||
#flag -I @VEXEROOT/thirdparty/stdatomic/win
|
#flag -I @VEXEROOT/thirdparty/stdatomic/win
|
||||||
|
#insert "@VEXEROOT/thirdparty/stdatomic/win/atomic.h"
|
||||||
} $else {
|
} $else {
|
||||||
#flag -I @VEXEROOT/thirdparty/stdatomic/nix
|
#flag -I @VEXEROOT/thirdparty/stdatomic/nix
|
||||||
|
#insert "@VEXEROOT/thirdparty/stdatomic/nix/atomic.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
$if linux {
|
$if linux {
|
||||||
@ -48,12 +50,6 @@ $if linux {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$if windows {
|
|
||||||
#insert "@VEXEROOT/thirdparty/stdatomic/win/atomic.h"
|
|
||||||
} $else {
|
|
||||||
#insert "@VEXEROOT/thirdparty/stdatomic/nix/atomic.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
// The following functions are actually generic in C
|
// The following functions are actually generic in C
|
||||||
fn C.atomic_load_ptr(voidptr) voidptr
|
fn C.atomic_load_ptr(voidptr) voidptr
|
||||||
fn C.atomic_store_ptr(voidptr, voidptr)
|
fn C.atomic_store_ptr(voidptr, voidptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user