-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.bat
125 lines (114 loc) · 3.46 KB
/
setup.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@echo off
REM
SET EXTERN_PATH_NATIVE="%~dp0toolchain_native\extern"
SET NAO_CTC="%~dp0toolchain_nao"
echo Generate "projectconfig.user.lua"
call :print_config > projectconfig.user.lua
REM try to find the protoc.exe, if it there we assume the path is already added
:check_protoc
where protoc.exe
if not errorlevel 1 goto protoc_exists
echo add the bin path (premake5 and all the dll)
setx PATH "%path%;%~dp0toolchain_native\extern\bin;"
echo added following to the PATH:
echo "%~dp0toolchain_native\extern\bin"
echo .
:protoc_exists
set /p answer=Set environment variables (Y/n)?
if /i "%answer:~,1%" EQU "N" goto add_mintty
echo set the path to the nao cross compile toolchain
setx NAO_CTC %NAO_CTC%
echo NAO_CTC=%NAO_CTC%
echo set the path to the external dependencies
setx EXTERN_PATH_NATIVE %EXTERN_PATH_NATIVE%
echo EXTERN_PATH_NATIVE=%EXTERN_PATH_NATIVE%
echo .
:add_mintty
REM try to find mintty.exe and generate add_mintty.reg
where mintty.exe
if errorlevel 1 (
echo Could not find mintty.exe
goto the_end
)
echo Generate "add_mintty.reg"
REM read the mintty.exe path
for /f "delims=" %%A in ('where mintty.exe') do set "MINTTY_PATH=%%A"
call :print_minnttyreg > add_mintty.reg
set /p answer=Add mintty to the context menu (Y/n)?
if /i "%answer:~,1%" EQU "N" goto the_end
echo add the mintty to the context menu
add_mintty.reg
:print_config
echo.
echo -- special pathes which can be configured manualy.
echo -- If a path is set to 'nil' the default value is used.
echo -- for default values check projectconfig.lua
echo.
echo -- default: "../../Framework"
echo FRAMEWORK_PATH = nil
echo.
echo -- for native platform
echo -- default: "../../Extern"
echo EXTERN_PATH_NATIVE = %EXTERN_PATH_NATIVE:\=/%
echo.
echo -- path to the crosscompiler and libs
echo -- default: os.getenv("NAO_CTC")
echo NAO_CTC = %NAO_CTC:\=/%
echo -- or set both explicitely
echo -- default: NAO_CTC .. "/compiler"
echo COMPILER_PATH_NAO = nil
echo -- default: NAO_CTC .. "/extern"
echo EXTERN_PATH_NAO = nil
echo.
echo -- naoqi toolchain needed to compile the NaoSMAL
echo -- default: os.getenv("AL_DIR")
echo AL_DIR = nil
echo.
echo.
echo -- optional: manualy enable/disable colors
echo -- print_colors = true
echo.
echo if PLATFORM == "Nao" then
echo _OPTIONS["crosscompiler"] = "gcc" -- set "clang" if needed
echo end
echo.
echo -- if _ACTION == "vs2019" then
echo -- flags{"MultiProcessorCompile"}
echo -- end
echo.
echo function set_user_defined_paths()
echo.
echo -- add your additional include directories here
echo -- sysincludedirs { "my/nao/includes/path1" }
echo.
echo -- add your additional lib directories here
echo --syslibdirs { "my/nao/libs/path1" }
echo.
echo -- NOTE: this should be used only for project internal files
echo -- use this ONLY if you know what you are doing
echo --includedirs {}
echo --libdirs {}
echo end
echo.
EXIT /B
:print_minnttyreg
echo Windows Registry Editor Version 5.00
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DesktopBackground\Shell\mintty]
echo @=""
echo "Extended"=""
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DesktopBackground\Shell\mintty\command]
echo @="%MINTTY_PATH:\=\\%"
echo.
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\mintty]
echo @=""
echo "Extended"=""
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\mintty\command]
echo @="%MINTTY_PATH:\=\\%"
echo.
EXIT /B
:the_end
pause