xref: /oneTBB/integration/windows/oneapi/vars.bat (revision 5f1ae0dc)
1@echo off
2REM
3REM Copyright (c) 2023 Intel Corporation
4REM
5REM Licensed under the Apache License, Version 2.0 (the "License");
6REM you may not use this file except in compliance with the License.
7REM You may obtain a copy of the License at
8REM
9REM     http://www.apache.org/licenses/LICENSE-2.0
10REM
11REM Unless required by applicable law or agreed to in writing, software
12REM distributed under the License is distributed on an "AS IS" BASIS,
13REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14REM See the License for the specific language governing permissions and
15REM limitations under the License.
16REM
17
18if not defined SETVARS_CALL (
19    echo:
20    echo :: ERROR: This script must be executed by setvars.bat.
21    echo:   Try '[install-dir]\setvars.bat --help' for help.
22    echo:
23    exit /b 255
24)
25
26if not defined ONEAPI_ROOT (
27    echo:
28    echo :: ERROR: This script requires that the ONEAPI_ROOT env variable is set."
29    echo:   Try '[install-dir]\setvars.bat --help' for help.
30    echo:
31    exit /b 254
32)
33
34set "TBBROOT=%ONEAPI_ROOT%"
35
36:: Set the default arguments
37set "TBB_TARGET_ARCH=%INTEL_TARGET_ARCH%"
38set TBB_TARGET_VS=
39set ARCH_SUFFIX=
40
41:ParseArgs
42:: Parse the incoming arguments
43if /i "%1"==""        goto SetEnv
44if /i "%1"=="vs2019"       (set TBB_TARGET_VS= )       & shift & goto ParseArgs
45if /i "%1"=="vs2022"       (set TBB_TARGET_VS= )       & shift & goto ParseArgs
46if /i "%1"=="all"          (set TBB_TARGET_VS=vc_mt)   & shift & goto ParseArgs
47
48if "%TBB_TARGET_ARCH%"=="ia32" set ARCH_SUFFIX=32
49
50:SetEnv
51if exist "%TBBROOT%\bin%ARCH_SUFFIX%\%TBB_TARGET_VS%\tbb12.dll" (
52    set "TBB_DLL_PATH=%TBBROOT%\bin%ARCH_SUFFIX%\%TBB_TARGET_VS%"
53)
54
55:End
56exit /B 0
57