2023-05-23 19:06:25 +02:00
|
|
|
Import("env")
|
|
|
|
|
|
|
|
c_env = env.Clone()
|
|
|
|
if env["platform"].startswith("windows"):
|
|
|
|
c_env.AppendUnique(LIBS=["python38"])
|
|
|
|
|
|
|
|
elif env["platform"].startswith("osx"):
|
|
|
|
c_env.AppendUnique(LIBS=["python3.8"])
|
|
|
|
# if we don't give the lib a proper install_name, macos won't be able to find it,
|
|
|
|
# and will link the cython modules with a relative path
|
|
|
|
c_env.AppendUnique(
|
|
|
|
LINKFLAGS=["-Wl,-rpath,'@loader_path/lib'", "-install_name", "@rpath/libpythonscript.dylib"]
|
|
|
|
)
|
|
|
|
c_env.AppendUnique(CFLAGS=["-Werror-implicit-function-declaration"])
|
|
|
|
|
|
|
|
else: # x11
|
|
|
|
c_env.AppendUnique(LIBS=["python3.8"])
|
|
|
|
c_env.AppendUnique(LINKFLAGS=["-Wl,-rpath,'$$ORIGIN/lib'"])
|
|
|
|
c_env.AppendUnique(CFLAGS=["-Werror-implicit-function-declaration"])
|
|
|
|
c_env.Depends("pythonscript.c", env["cpython_build"])
|
|
|
|
|
|
|
|
|
|
|
|
libpythonscript, *libpythonscript_extra = c_env.SharedLibrary("pythonscript", ["pythonscript.c"])
|
|
|
|
env.Install("$DIST_PLATFORM", [libpythonscript, *libpythonscript_extra])
|
|
|
|
|
|
|
|
|
|
|
|
# Cython modules depend on libpythonscript
|
|
|
|
env.AppendUnique(LIBPATH=[Dir(".")])
|
|
|
|
env.AppendUnique(CYTHON_COMPILE_DEPS=[libpythonscript])
|
|
|
|
|
|
|
|
|
2023-06-02 11:13:10 +02:00
|
|
|
SConscript(["pandemoniummonium/SConscript"])
|
2023-05-23 19:06:25 +02:00
|
|
|
|
|
|
|
|
2023-06-02 11:13:10 +02:00
|
|
|
# `_pandemonium_api.h` is only for internal use between _pandemoniummonium and pythonscript
|
2023-05-23 19:06:25 +02:00
|
|
|
# libraries, hence no need to provide it as part of the release
|
|
|
|
*mods, _ = env.CythonModule(
|
2023-06-02 11:13:10 +02:00
|
|
|
["_pandemoniummonium", "_pandemonium_api.h"],
|
2023-05-23 19:06:25 +02:00
|
|
|
[
|
2023-06-02 11:13:10 +02:00
|
|
|
"_pandemoniummonium.pyx",
|
2023-06-02 11:05:45 +02:00
|
|
|
"_pandemonium_editor.pxi",
|
|
|
|
"_pandemonium_instance.pxi",
|
|
|
|
"_pandemonium_profiling.pxi",
|
|
|
|
"_pandemonium_script.pxi",
|
|
|
|
"_pandemonium_io.pxi",
|
2023-05-23 19:06:25 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
env.Install("$DIST_SITE_PACKAGES", mods)
|