From 4b69958c955758a5d87412b6f23bd85018b25580 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Thu, 27 Apr 2023 18:52:39 -0400 Subject: [PATCH] improve compatibility with Windows (though it still doesn't work) --- python/olm_build.py | 3 +-- python/packaging.diff | 13 ++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/python/olm_build.py b/python/olm_build.py index 070c06e..5ea9d54 100644 --- a/python/olm_build.py +++ b/python/olm_build.py @@ -26,7 +26,6 @@ PATH = os.path.dirname(__file__) DEVELOP = os.environ.get("DEVELOP") compile_args = ["-I../include"] -link_args = ["-L../build"] if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]: link_args.append('-Wl,-rpath=../build') @@ -44,8 +43,8 @@ ffibuilder.set_source( #include """, libraries=["olm"], + library_dirs=[os.path.join("..", "build")], extra_compile_args=compile_args, - extra_link_args=link_args, source_extension=".cpp", # we need to link the C++ standard library, so use a C++ extension ) diff --git a/python/packaging.diff b/python/packaging.diff index bb1740c..a355fc8 100644 --- a/python/packaging.diff +++ b/python/packaging.diff @@ -12,14 +12,12 @@ +recursive-include libolm/tests * --- a/olm_build.py +++ b/olm_build.py -@@ -25,13 +25,30 @@ +@@ -25,12 +25,29 @@ DEVELOP = os.environ.get("DEVELOP") -compile_args = ["-I../include"] --link_args = ["-L../build"] +compile_args = ["-Ilibolm/include"] -+link_args = ["-Llibolm/build"] if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]: link_args.append('-Wl,-rpath=../build') @@ -47,3 +45,12 @@ + subprocess.run(["make", "static"], cwd="libolm", check=True) ffibuilder.set_source( +@@ -43,7 +60,7 @@ + #include + """, + libraries=["olm"], +- library_dirs=[os.path.join("..", "build")], ++ library_dirs=[os.path.join("libolm", "build")], + extra_compile_args=compile_args, + source_extension=".cpp", # we need to link the C++ standard library, so use a C++ extension + )