Skip to content

Commit

Permalink
Remove redundant code in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Oct 19, 2023
1 parent e4f6788 commit 9d13804
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ def initialize_options(self):
8) <= sys.version_info[:2] and sys.platform == "darwin" and multiprocessing.get_start_method() == "spawn":
multiprocessing.set_start_method("fork", force=True)

# Set up some values for use in setup()
libs, libdirs, includes, cflags = define_lib_includes_cflags()

cflags = []
# NOTE: For performance. Check if other platforms need an equivalent change.
if sys.platform == "darwin":
cflags.append("-DCYTHON_INLINE=inline __attribute__ ((__unused__)) __attribute__((always_inline))")
Expand All @@ -39,9 +37,6 @@ def initialize_options(self):
lambda src: Extension(
src.split(".")[0].replace(os.sep, "."),
[src],
include_dirs=includes,
library_dirs=libdirs,
libraries=libs,
extra_compile_args=cflags,
), list(py_pxd_files)
)
Expand All @@ -66,18 +61,6 @@ def initialize_options(self):
)


# Define libs, libdirs, includes and cflags for SDL2
def define_lib_includes_cflags():
libs = []
libdirs = []
includes = []
cflags = [
"-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include"
] if sys.platform == "darwin" else []

return libs, libdirs, includes, cflags


def prep_pxd_py_files():
ignore_py_files = ["__main__.py", "manager_gen.py", "opcodes_gen.py"]
# Cython doesn't trigger a recompile on .py files, where only the .pxd file has changed. So we fix this here.
Expand Down

0 comments on commit 9d13804

Please sign in to comment.