Last active
August 7, 2022 09:20
-
-
Save fzn0268/3f81a99e6cc510fec8bc1f2a6716b43b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set environment variables for using MSVC 14, | |
| # for creating native 64-bit Windows executables. | |
| # Windows C library headers and libraries. | |
| WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt' | |
| WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\' | |
| INCLUDE="${WindowsCrtIncludeDir};$INCLUDE" | |
| LIB="${WindowsCrtLibDir}x64;$LIB" | |
| # Windows API headers and libraries. | |
| WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\' | |
| WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\' | |
| INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE" | |
| LIB="${WindowsSdkLibDir}x64;$LIB" | |
| # Visual C++ tools, headers and libraries. | |
| VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools' | |
| VCINSTALLDIR="${VSINSTALLDIR}"'\VC\Tools\MSVC\14.29.30133\' | |
| PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/Hostx64/x64:"$PATH" | |
| INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}" | |
| LIB="${VCINSTALLDIR}"'\lib\x64;'"${LIB}" | |
| export INCLUDE LIB | |
| PATH=/usr/local/msvc64/bin:$PATH | |
| export PATH | |
| win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0 | |
| win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0 | |
| win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0 | |
| win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0 | |
| ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \ | |
| CC="$HOME/msvc/compile cl -nologo" \ | |
| CFLAGS="-MD -utf-8" \ | |
| CXX="$HOME/msvc/compile cl -nologo" \ | |
| CXXFLAGS="-MD -utf-8" \ | |
| CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \ | |
| RC="windres -Fpe-x86-64" \ | |
| WINDRES="windres -Fpe-x86-64" \ | |
| LDFLAGS="-L/usr/local/msvc64/lib" \ | |
| LD="link" \ | |
| NM="dumpbin -symbols" \ | |
| STRIP=":" \ | |
| AR="$HOME/msvc/ar-lib lib" \ | |
| RANLIB=":" | |
| make | |
| make check | |
| make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment