Skip to content

Commit 0033ddc

Browse files
authored
Revert "Remove vs2019 folder (#8581)" (#8582)
1 parent f5d9ecd commit 0033ddc

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed

packaging/vs2019/activate.bat

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
:: Set env vars that tell distutils to use the compiler that we put on path
2+
SET DISTUTILS_USE_SDK=1
3+
SET MSSdk=1
4+
5+
SET "VS_VERSION=16.0"
6+
SET "VS_MAJOR=16"
7+
SET "VS_YEAR=2019"
8+
9+
set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"
10+
set "MSYS2_ENV_CONV_EXCL=CL"
11+
12+
:: For Python 3.5+, ensure that we link with the dynamic runtime. See
13+
:: http://stevedower.id.au/blog/building-for-python-3-5-part-two/ for more info
14+
set "PY_VCRUNTIME_REDIST=%PREFIX%\\bin\\vcruntime140.dll"
15+
16+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [16^,17^) -property installationPath`) do (
17+
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
18+
set "VSINSTALLDIR=%%i\"
19+
goto :vswhere
20+
)
21+
)
22+
23+
:vswhere
24+
25+
:: Shorten PATH to avoid the `input line too long` error.
26+
SET MyPath=%PATH%
27+
28+
setlocal EnableDelayedExpansion
29+
30+
SET TempPath="%MyPath:;=";"%"
31+
SET var=
32+
FOR %%a IN (%TempPath%) DO (
33+
IF EXIST %%~sa (
34+
SET "var=!var!;%%~sa"
35+
)
36+
)
37+
38+
set "TempPath=!var:~1!"
39+
endlocal & set "PATH=%TempPath%"
40+
41+
:: Shorten current directory too
42+
FOR %%A IN (.) DO CD "%%~sA"
43+
44+
:: other things added by install_activate.bat at package build time
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
blas_impl:
2+
- mkl # [x86_64]
3+
c_compiler:
4+
- vs2019 # [win]
5+
cxx_compiler:
6+
- vs2019 # [win]
7+
python:
8+
- 3.8
9+
# This differs from target_platform in that it determines what subdir the compiler
10+
# will target, not what subdir the compiler package will be itself.
11+
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32
12+
# code on win-64 miniconda.
13+
cross_compiler_target_platform:
14+
- win-64 # [win]
15+
target_platform:
16+
- win-64 # [win]
17+
vc:
18+
- 14
19+
zip_keys:
20+
- # [win]
21+
- vc # [win]
22+
- c_compiler # [win]
23+
- cxx_compiler # [win]

packaging/vs2019/install_activate.bat

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
set YEAR=2019
2+
set VER=16
3+
4+
mkdir "%PREFIX%\etc\conda\activate.d"
5+
COPY "%RECIPE_DIR%\activate.bat" "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
6+
7+
IF "%cross_compiler_target_platform%" == "win-64" (
8+
set "target_platform=amd64"
9+
echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR% Win64" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
10+
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
11+
IF "%VSDEVCMD_ARGS%" == "" (
12+
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
13+
echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
14+
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
15+
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
16+
) ELSE (
17+
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
18+
echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
19+
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
20+
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
21+
)
22+
echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
23+
) else (
24+
set "target_platform=x86"
25+
echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
26+
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
27+
echo CALL "VC\Auxiliary\Build\vcvars32.bat" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
28+
echo popd
29+
)

packaging/vs2019/meta.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% set vcver="14.2" %}
2+
{% set vcfeature="14" %}
3+
{% set vsyear="2019" %}
4+
{% set fullver="15.4.27004.2010" %}
5+
6+
package:
7+
name: vs{{ vsyear }}
8+
version: {{ fullver }}
9+
10+
build:
11+
skip: True [not win]
12+
script_env:
13+
- VSDEVCMD_ARGS # [win]
14+
15+
outputs:
16+
- name: vs{{ vsyear }}_{{ cross_compiler_target_platform }}
17+
script: install_activate.bat
18+
track_features:
19+
# VS 2019 is binary-compatible with VS 2017/vc 14.1 and 2015/vc14. Tools are "v142".
20+
strong:
21+
- vc{{ vcfeature }}
22+
about:
23+
summary: Activation and version verification of MSVC {{ vcver }} (VS {{ vsyear }}) compiler
24+
license: BSD 3-clause

0 commit comments

Comments
 (0)