Skip to content

Commit

Permalink
Use c++ instead of cc
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush committed Aug 28, 2020
1 parent 7dcba1a commit 3b8044a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,22 @@ def check_linker_need_libatomic():
"""Test if linker on system needs libatomic."""
code_test = (b'#include <atomic>\n' +
b'int main() { return std::atomic<int64_t>{}; }')
cc_test = subprocess.Popen(['cc', '-x', 'c++', '-std=c++11', '-'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
cc_test.communicate(input=code_test)
if cc_test.returncode == 0:
cpp_test = subprocess.Popen(['c++', '-x', 'c++', '-std=c++11', '-'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
cpp_test.communicate(input=code_test)
if cpp_test.returncode == 0:
return False
# Double-check to see if -latomic actually can solve the problem.
# https://github.com/grpc/grpc/issues/22491
cc_test = subprocess.Popen(
['cc', '-x', 'c++', '-std=c++11', '-latomic', '-'],
cpp_test = subprocess.Popen(
['c++', '-x', 'c++', '-std=c++11', '-latomic', '-'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
cc_test.communicate(input=code_test)
return cc_test.returncode == 0
cpp_test.communicate(input=code_test)
return cpp_test.returncode == 0


# There are some situations (like on Windows) where CC, CFLAGS, and LDFLAGS are
Expand Down

0 comments on commit 3b8044a

Please sign in to comment.