This commit is contained in:
gingerBill
2020-08-26 22:41:06 +01:00
8 changed files with 36 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ assignees: ''
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
* Operating System:
* Odin version/Commit:
* Please paste `odin version` output:
## Expected Behavior

View File

@@ -44,7 +44,7 @@ jobs:
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
./ci/build_ci.bat
./build.bat 1
- name: Odin run
shell: cmd
run: |

View File

@@ -22,7 +22,7 @@ jobs:
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
./ci/build_ci.bat
./build.bat 1 1
- name: Odin run
shell: cmd
run: |

View File

@@ -1,6 +1,7 @@
GIT_SHA=$(shell git rev-parse --short HEAD)
DISABLED_WARNINGS=-Wno-switch -Wno-pointer-sign -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-macro-redefined
LDFLAGS=-pthread -ldl -lm -lstdc++
CFLAGS=-std=c++11
CFLAGS=-std=c++11 -DGIT_SHA=\"$(GIT_SHA)\"
CC=clang
OS=$(shell uname)
@@ -20,5 +21,8 @@ debug:
release:
$(CC) src/main.cpp $(DISABLED_WARNINGS) $(CFLAGS) -O3 -march=native $(LDFLAGS) -o odin
nightly:
$(CC) src/main.cpp $(DISABLED_WARNINGS) $(CFLAGS) -DNIGHTLY -O3 -march=native $(LDFLAGS) -o odin

View File

@@ -12,9 +12,19 @@ if "%1" == "1" (
set release_mode=0
)
set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DLLVM_BACKEND_SUPPORT
:: Normal = 0, CI Nightly = 1
if "%2" == "1" (
set nightly=1
) else (
set nightly=0
)
set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DLLVM_BACKEND_SUPPORT
for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i
if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\"
if %nightly% equ 1 set compiler_defines=%compiler_defines% -DNIGHTLY
if %release_mode% EQU 0 ( rem Debug
set compiler_flags=%compiler_flags% -Od -MDd -Z7
@@ -49,12 +59,10 @@ set linker_settings=%libs% %linker_flags%
del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL
cl %compiler_settings% "src\main.cpp" ^
/link %linker_settings% -OUT:%exe_name% ^
&& odin run examples/demo/demo.odin
if %errorlevel% neq 0 (
goto end_of_build
)
cl %compiler_settings% "src\main.cpp" /link %linker_settings% -OUT:%exe_name%
if %errorlevel% neq 0 goto end_of_build
if %release_mode% EQU 0 odin run examples/demo/demo.odin
del *.obj > NUL 2> NUL

View File

@@ -1,31 +0,0 @@
@echo off
:: Make sure this is a decent name and not generic
set exe_name=odin.exe
set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF -O2 -MT -Z7
set compiler_defines= -DLLVM_BACKEND_SUPPORT -DNO_ARRAY_BOUNDS_CHECK
set compiler_warnings= ^
-W4 -WX ^
-wd4100 -wd4101 -wd4127 -wd4189 ^
-wd4201 -wd4204 ^
-wd4456 -wd4457 -wd4480 ^
-wd4512
set compiler_includes=
set libs= ^
kernel32.lib ^
bin\llvm\windows\LLVM-C.lib
set linker_flags= -incremental:no -opt:ref -subsystem:console -debug
set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%
del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL
cl %compiler_settings% "src\main.cpp" /link %linker_settings% -OUT:%exe_name%
:end_of_build

View File

@@ -2,7 +2,7 @@ package container
Ring :: struct(T: typeid) {
next, prev: ^Ring,
next, prev: ^Ring(T),
value: T,
}

View File

@@ -1684,7 +1684,17 @@ int main(int arg_count, char const **arg_ptr) {
return 1;
#endif
} else if (command == "version") {
gb_printf("%.*s version %.*s\n", LIT(args[0]), LIT(ODIN_VERSION));
gb_printf("%.*s version %.*s", LIT(args[0]), LIT(ODIN_VERSION));
#ifdef NIGHTLY
gb_printf("-nightly");
#endif
#ifdef GIT_SHA
gb_printf("-%s", GIT_SHA);
#endif
gb_printf("\n");
return 0;
} else {
usage(args[0]);