Skip to content

Commit

Permalink
cffi: respect CC environment variable for defining compiler
Browse files Browse the repository at this point in the history
Closes #103.
  • Loading branch information
indygreg committed Dec 24, 2020
1 parent f98a227 commit 51edf5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Backwards Compatibility Notes
Changes
-------

* The ``make_cffi.py`` script should now respect the ``CC`` environment
variable for locating the compiler. (#103)
* CI now properly uses the ``cffi`` backend when running all tests.
* ``train_dictionary()`` has been rewritten to use the ``fastcover`` APIs
and to consistently call ``ZDICT_optimizeTrainFromBuffer_fastCover()``
Expand Down
5 changes: 3 additions & 2 deletions make_cffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@
# Distutils doesn't set compiler.preprocessor, so invoke the preprocessor
# manually.
if compiler.compiler_type == "unix":
args = list(compiler.executables["compiler"])
# Using .compiler respects the CC environment variable.
args = [compiler.compiler[0]]
args.extend(
["-E", "-DZSTD_STATIC_LINKING_ONLY", "-DZDICT_STATIC_LINKING_ONLY",]
)
elif compiler.compiler_type == "msvc":
args = [compiler.cc]
args = [compiler.compiler[0]]
args.extend(
["/EP", "/DZSTD_STATIC_LINKING_ONLY", "/DZDICT_STATIC_LINKING_ONLY",]
)
Expand Down

0 comments on commit 51edf5d

Please sign in to comment.