Skip to content

Commit d74f48a

Browse files
committed
Remove VS 2017 Conda scripts, unify casing in conda Batch scripts, minor Conda scripts tweaks
1 parent 3d208f3 commit d74f48a

File tree

9 files changed

+51
-181
lines changed

9 files changed

+51
-181
lines changed

conda/vs2017/activate.bat

Lines changed: 0 additions & 44 deletions
This file was deleted.

conda/vs2017/conda_build_config.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

conda/vs2017/install_activate.bat

Lines changed: 0 additions & 24 deletions
This file was deleted.

conda/vs2017/install_runtime.bat

Lines changed: 0 additions & 49 deletions
This file was deleted.

conda/vs2017/meta.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

conda/vs2022/activate.bat

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
:: 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
2+
set DISTUTILS_USE_SDK=1
3+
set MSSdk=1
44

5-
SET "VS_VERSION=17.4"
6-
SET "VS_MAJOR=17"
7-
SET "VC_YEAR=2022"
8-
SET "VC_VERSION_LOWER=17"
5+
set "VS_VERSION=17.4"
6+
set "VS_MAJOR=17"
7+
set "VC_YEAR=2022"
8+
set "VC_VERSION_LOWER=17"
99
set "VC_VERSION_UPPER=18"
1010

1111
set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"
@@ -15,7 +15,7 @@ set "MSYS2_ENV_CONV_EXCL=CL"
1515
:: http://stevedower.id.au/blog/building-for-python-3-5-part-two/ for more info
1616
set "PY_VCRUNTIME_REDIST=%PREFIX%\\bin\\vcruntime143.dll"
1717

18-
if NOT "%VS15INSTALLDIR%" == "" if exist "%VS15INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" (
18+
if not "%VS15INSTALLDIR%" == "" if exist "%VS15INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" (
1919
set "VSINSTALLDIR=%VS15INSTALLDIR%\"
2020
goto :vswhere
2121
)
@@ -30,22 +30,22 @@ for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio
3030
:vswhere
3131

3232
:: Shorten PATH to avoid the `input line too long` error.
33-
SET MyPath=%PATH%
33+
set MyPath=%PATH%
3434

3535
setlocal EnableDelayedExpansion
3636

37-
SET TempPath="%MyPath:;=";"%"
38-
SET var=
39-
FOR %%a IN (%TempPath%) DO (
40-
IF EXIST %%~sa (
41-
SET "var=!var!;%%~sa"
37+
set TempPath="%MyPath:;=";"%"
38+
set var=
39+
for %%a in (%TempPath%) do (
40+
if exist %%~sa (
41+
set "var=!var!;%%~sa"
4242
)
4343
)
4444

4545
set "TempPath=!var:~1!"
4646
endlocal & set "PATH=%TempPath%"
4747

4848
:: Shorten current directory too
49-
FOR %%A IN (.) DO CD "%%~sA"
49+
for %%A in (.) do cd "%%~sA"
5050

5151
:: other things added by install_activate.bat at package build time

conda/vs2022/conda_build_config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ c_compiler:
55
cxx_compiler:
66
- vs2022 # [win]
77
python:
8-
- 3.5
9-
- 3.6
8+
- 3.8
9+
- 3.9
10+
- 3.10
1011
# This differs from target_platform in that it determines what subdir the compiler
1112
# will target, not what subdir the compiler package will be itself.
1213
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32

conda/vs2022/install.bat

Whitespace-only changes.

conda/vs2022/install.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
from os import environ, makedirs, open
3+
from os.path import exists
4+
from shutil import copy
5+
6+
VC_YEAR = 2022
7+
VC_VERSION = 17
8+
9+
PREFIX = environ.get('PREFIX')
10+
RECIPE_DIR = environ.get('RECIPE_DIR')
11+
VSDEVCMD_ARGS = environ.get('VSDEVCMD_ARGS')
12+
13+
14+
def activate_vsdevcmd():
15+
pass
16+
17+
18+
activate_script_dir = f'{PREFIX}\\etc\\conda\\activate.d'
19+
if not exists(activate_script_dir):
20+
makedirs(activate_script_dir)
21+
22+
activate_script_file = f'{activate_script_dir}\\vs{VC_YEAR}_compiler_vars.bat'
23+
copy(f'{RECIPE_DIR}\\activate.bat', activate_script_file)
24+
25+
environ['target_platform'] = "amd64" if environ.get('cross_compiler_target_platform') == "win-64" else "x86"
26+
with open(activate_script_file, "a") as file:
27+
file.write(f'set CMAKE_GENERATOR=Visual Studio {VC_VERSION} {VC_YEAR} Win64\n')
28+
file.write('pushd %VSINSTALLDIR%\n')
29+
if environ.get('cross_compiler_target_platform') == "win-64":
30+
file.write(f'call "VC\\Auxiliary\\Build\\vcvarsall.bat" x64 {VSDEVCMD_ARGS}\n')
31+
else:
32+
file.write(f'call "VC\\Auxiliary\\Build\\vcvars32.bat\n {VSDEVCMD_ARGS}\n')
33+
file.write('popd\n')
34+
"""

0 commit comments

Comments
 (0)