diff options
author | Masood Malekghassemi <atash@google.com> | 2016-07-07 11:24:39 -0700 |
---|---|---|
committer | Masood Malekghassemi <atash@google.com> | 2016-07-13 14:33:33 -0700 |
commit | d66be0b6f6bcdb0745d54d19db0457863f9a9efd (patch) | |
tree | 0c0ef4884162f85639969783033cd91715c4949d /tools/run_tests | |
parent | 20b1d58b0c4d44abc04af6c6467b7b217fe54915 (diff) |
Set more build-flags in `setup.py`s
Removes MinGW flags from various build scripts, since they're now set in
our `setup.py`s by default. Also removes the arguments for the
extensions in grpcio's setup.py; that function was already accessing
globals anyway, might as well go whole-hog.
Diffstat (limited to 'tools/run_tests')
-rw-r--r-- | tools/run_tests/build_artifact_python.bat | 23 | ||||
-rwxr-xr-x | tools/run_tests/build_python.sh | 13 |
2 files changed, 0 insertions, 36 deletions
diff --git a/tools/run_tests/build_artifact_python.bat b/tools/run_tests/build_artifact_python.bat index 7c8c2aa12d..a7b1a58284 100644 --- a/tools/run_tests/build_artifact_python.bat +++ b/tools/run_tests/build_artifact_python.bat @@ -34,29 +34,6 @@ pip install --upgrade six pip install --upgrade setuptools pip install -rrequirements.txt -@rem Because this is windows and *everything seems to hate Windows* we have to -@rem set all of these flags ourselves because Python won't help us (see the -@rem setup.py of the grpcio_tools project). -set GRPC_PYTHON_CFLAGS=-fno-wrapv -frtti -std=c++11 - -@rem See https://sourceforge.net/p/mingw-w64/bugs/363/ -if %2 == 32 ( - set GRPC_PYTHON_CFLAGS=%GRPC_PYTHON_CFLAGS% -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s -) else ( - set GRPC_PYTHON_CFLAGS=%GRPC_PYTHON_CFLAGS% -D_ftime=_ftime64 -D_timeb=__timeb64 -) - -@rem Further confusing things, MSYS2's mingw64 tries to dynamically link -@rem libgcc, libstdc++, and winpthreads. We have to override this or our -@rem extensions end up linking to MSYS2 DLLs, which the normal Python on -@rem Windows user won't have... and ON TOP OF THIS, there's MinGW's GCC default -@rem behavior of linking msvcrt.dll as the C runtime library, which we need to -@rem override so that Python's distutils doesn't link us against multiple C -@rem runtimes. -python -c "from distutils.cygwinccompiler import get_msvcr; print(get_msvcr()[0])" > temp.txt -set /p PYTHON_MSVCR=<temp.txt -set GRPC_PYTHON_LDFLAGS=-static-libgcc -static-libstdc++ -mcrtdll=%PYTHON_MSVCR% -static -lpthread - set GRPC_PYTHON_BUILD_WITH_CYTHON=1 diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index a3fa8200d5..9cb3cb12a9 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -127,19 +127,6 @@ if [ $(is_linux) ]; then fi fi fi -# TODO(atash) consider conceptualizing MinGW as a first-class platform and move -# these flags into our `setup.py`s -if [ $(is_mingw) ]; then - # We're on MinGW, and our CFLAGS and LDFLAGS will be eaten by the void. Use - # our work-around environment variables instead. - PYTHON_MSVCR=`$PYTHON -c "from distutils.cygwinccompiler import get_msvcr; print(get_msvcr()[0])"` - export GRPC_PYTHON_LDFLAGS="-static-libgcc -static-libstdc++ -mcrtdll=$PYTHON_MSVCR -static -lpthread" - # See https://sourceforge.net/p/mingw-w64/bugs/363/ - export GRPC_PYTHON_CFLAGS="-D_ftime=_ftime64 -D_timeb=__timeb64" - # TODO(atash) set these flags for only grpcio-tools (they don't do any harm to - # grpcio, but they result in noisy warnings). - export GRPC_PYTHON_CFLAGS="-frtti -std=c++11 $GRPC_PYTHON_CFLAGS" -fi ############################ # Perform build operations # |