From 1d9ca414c24e331d69f6d157ddf51a293ac70689 Mon Sep 17 00:00:00 2001 From: Andrew Prock Date: Fri, 26 Jul 2024 14:07:57 -0700 Subject: [PATCH] fix python for MacOS --- src/lib/python/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/python/CMakeLists.txt b/src/lib/python/CMakeLists.txt index b6d9144..b039f89 100644 --- a/src/lib/python/CMakeLists.txt +++ b/src/lib/python/CMakeLists.txt @@ -28,6 +28,15 @@ swig_add_library(${PS_TARGET} LANGUAGE python OUTPUT_DIR ${PYTHON_PROJECT_DIR} SOURCES pokerstove.i) +add_library(${PROJECT_NAMESPACE}::${PS_TARGET} ALIAS ${PS_TARGET}) + +# note: macOS is APPLE and also UNIX ! +if(APPLE) + set_property(TARGET ${PS_TARGET} APPEND PROPERTY + LINK_FLAGS "-flat_namespace -undefined suppress" + ) +endif() + # This is done to ensure that the .py wrapper and the .so file are in the # same location so that a properly set PYTHONPATH will pick them up.