diff --git a/build-win32-cpu+cuda.bat b/build-win32-cpu+cuda.bat index 19a3b6a..e03bc38 100644 --- a/build-win32-cpu+cuda.bat +++ b/build-win32-cpu+cuda.bat @@ -1,9 +1,8 @@ @echo off setlocal ENABLEDELAYEDEXPANSION -for %%V in (15,14,12,11) do if exist "!VS%%V0COMNTOOLS!" call "!VS%%V0COMNTOOLS!..\..\VC\vcvarsall.bat" x86 && goto compile +call "vcvarsall.bat" x86 -:compile nvcc -m32 -arch compute_30 src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_cuda.cu -DNDEBUG -O6 -I "include" -o "bin\ebsynth.exe" -Xcompiler "/openmp /fp:fast" -Xlinker "/IMPLIB:dummy.lib" -w || goto error nvcc -m32 -arch compute_30 src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_cuda.cu -DNDEBUG -O6 -I "include" -o "bin\ebsynth.dll" -Xcompiler "/openmp /fp:fast" -Xlinker "/IMPLIB:lib\ebsynth.lib" -shared -DEBSYNTH_API=__declspec(dllexport) -w || goto error del dummy.lib;dummy.exp 2> NUL diff --git a/build-win32-cpu_only.bat b/build-win32-cpu_only.bat index 1c7cd93..328d1f1 100644 --- a/build-win32-cpu_only.bat +++ b/build-win32-cpu_only.bat @@ -1,9 +1,8 @@ @echo off setlocal ENABLEDELAYEDEXPANSION -for %%V in (15,14,12,11) do if exist "!VS%%V0COMNTOOLS!" call "!VS%%V0COMNTOOLS!..\..\VC\vcvarsall.bat" x86 && goto compile +call "vcvarsall.bat" x86 -:compile cl src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_nocuda.cpp /DNDEBUG /O2 /openmp /EHsc /nologo /I"include" /Fe"bin\ebsynth.exe" || goto error cl src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_nocuda.cpp /DNDEBUG /O2 /openmp /EHsc /nologo /I"include" /Fe"bin\ebsynth.dll" /DEBSYNTH_API="__declspec(dllexport)" /link /IMPLIB:"lib\ebsynth.lib" || goto error del ebsynth.obj;ebsynth_cpu.obj;ebsynth_nocuda.obj 2> NUL diff --git a/build-win64-cpu+cuda.bat b/build-win64-cpu+cuda.bat index 7a25549..65d63a1 100644 --- a/build-win64-cpu+cuda.bat +++ b/build-win64-cpu+cuda.bat @@ -1,9 +1,8 @@ @echo off setlocal ENABLEDELAYEDEXPANSION -for %%V in (15,14,12,11) do if exist "!VS%%V0COMNTOOLS!" call "!VS%%V0COMNTOOLS!..\..\VC\vcvarsall.bat" amd64 && goto compile +call "vcvarsall.bat" amd64 -:compile nvcc -arch compute_30 src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_cuda.cu -DNDEBUG -O6 -I "include" -o "bin\ebsynth.exe" -Xcompiler "/openmp /fp:fast" -Xlinker "/IMPLIB:dummy.lib" -w || goto error nvcc -arch compute_30 src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_cuda.cu -DNDEBUG -O6 -I "include" -o "bin\ebsynth.dll" -Xcompiler "/openmp /fp:fast" -Xlinker "/IMPLIB:lib\ebsynth.lib" -shared -DEBSYNTH_API=__declspec(dllexport) -w || goto error del dummy.lib;dummy.exp 2> NUL diff --git a/build-win64-cpu_only.bat b/build-win64-cpu_only.bat index abf2df7..5a9fd5e 100644 --- a/build-win64-cpu_only.bat +++ b/build-win64-cpu_only.bat @@ -1,9 +1,8 @@ @echo off setlocal ENABLEDELAYEDEXPANSION -for %%V in (15,14,12,11) do if exist "!VS%%V0COMNTOOLS!" call "!VS%%V0COMNTOOLS!..\..\VC\vcvarsall.bat" amd64 && goto compile +call "vcvarsall.bat" amd64 -:compile cl src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_nocuda.cpp /DNDEBUG /O2 /openmp /EHsc /nologo /I"include" /Fe"bin\ebsynth.exe" || goto error cl src\ebsynth.cpp src\ebsynth_cpu.cpp src\ebsynth_nocuda.cpp /DNDEBUG /O2 /openmp /EHsc /nologo /I"include" /Fe"bin\ebsynth.dll" /DEBSYNTH_API="__declspec(dllexport)" /link /IMPLIB:"lib\ebsynth.lib" || goto error del ebsynth.obj;ebsynth_cpu.obj;ebsynth_nocuda.obj 2> NUL diff --git a/vcvarsall.bat b/vcvarsall.bat new file mode 100644 index 0000000..e5597fb --- /dev/null +++ b/vcvarsall.bat @@ -0,0 +1,16 @@ +@echo off + +for /f "usebackq tokens=*" %%i in (`vswhere -latest -legacy -property installationPath`) do (set vsdir=%%i) +for /f "usebackq tokens=*" %%i in (`vswhere -latest -legacy -property installationVersion`) do (set vsver=%%i) + +if %vsver% geq 15 ( + set vcvarsall="%vsdir%\VC\Auxiliary\Build\vcvarsall.bat" +) else ( + set vcvarsall="%vsdir%\VC\vcvarsall.bat" +) + +echo %vcvarsall% + +if exist %vcvarsall% ( + call %vcvarsall% %* +) diff --git a/vswhere.exe b/vswhere.exe new file mode 100644 index 0000000..ecfb3bf Binary files /dev/null and b/vswhere.exe differ