contrib/python-zstandard/make_cffi.py
changeset 45942 89a2afe31e82
parent 44147 5e84a96d865b
child 48875 6000f5b25c9b
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
    51 ]
    51 ]
    52 
    52 
    53 # Headers whose preprocessed output will be fed into cdef().
    53 # Headers whose preprocessed output will be fed into cdef().
    54 HEADERS = [
    54 HEADERS = [
    55     os.path.join(HERE, "zstd", *p)
    55     os.path.join(HERE, "zstd", *p)
    56     for p in (("zstd.h",), ("dictBuilder", "zdict.h"),)
    56     for p in (
       
    57         ("zstd.h",),
       
    58         ("dictBuilder", "zdict.h"),
       
    59     )
    57 ]
    60 ]
    58 
    61 
    59 INCLUDE_DIRS = [
    62 INCLUDE_DIRS = [
    60     os.path.join(HERE, d)
    63     os.path.join(HERE, d)
    61     for d in (
    64     for d in (
    78 # Distutils doesn't set compiler.preprocessor, so invoke the preprocessor
    81 # Distutils doesn't set compiler.preprocessor, so invoke the preprocessor
    79 # manually.
    82 # manually.
    80 if compiler.compiler_type == "unix":
    83 if compiler.compiler_type == "unix":
    81     args = list(compiler.executables["compiler"])
    84     args = list(compiler.executables["compiler"])
    82     args.extend(
    85     args.extend(
    83         ["-E", "-DZSTD_STATIC_LINKING_ONLY", "-DZDICT_STATIC_LINKING_ONLY",]
    86         [
       
    87             "-E",
       
    88             "-DZSTD_STATIC_LINKING_ONLY",
       
    89             "-DZDICT_STATIC_LINKING_ONLY",
       
    90         ]
    84     )
    91     )
    85 elif compiler.compiler_type == "msvc":
    92 elif compiler.compiler_type == "msvc":
    86     args = [compiler.cc]
    93     args = [compiler.cc]
    87     args.extend(
    94     args.extend(
    88         ["/EP", "/DZSTD_STATIC_LINKING_ONLY", "/DZDICT_STATIC_LINKING_ONLY",]
    95         [
       
    96             "/EP",
       
    97             "/DZSTD_STATIC_LINKING_ONLY",
       
    98             "/DZDICT_STATIC_LINKING_ONLY",
       
    99         ]
    89     )
   100     )
    90 else:
   101 else:
    91     raise Exception("unsupported compiler type: %s" % compiler.compiler_type)
   102     raise Exception("unsupported compiler type: %s" % compiler.compiler_type)
    92 
   103 
    93 
   104