Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Popov <v.popov@corp.mail.ru>2020-09-30 13:36:45 +0300
committermpimenov <mpimenov@users.noreply.github.com>2020-11-06 11:58:39 +0300
commit5d3c6897ba30e933b848be551ee5a5e1c27059b6 (patch)
tree7af9c727325778ebddfbfda21f5a8d69da630e87
parentdf6c1e38241ce224e01382b0c86caea8c9f6f9ab (diff)
[pybindings] Fix linking on Macpy-modules-10.3.0rc2
Mac has different linker defaults than linux, and by default it does not allow undefined symbols to be left in resulting pybinding library. To allow it, we specifically pass linker argument when linking final pybinding object. This is done to avoid linking excessively to libpythonX.Y since at the time pybinding is loaded into Python process, all libpython symbols would be immediately available.
-rw-r--r--generator/mwm_diff/pymwm_diff/CMakeLists.txt4
-rw-r--r--generator/pygen/CMakeLists.txt4
-rw-r--r--kml/pykmlib/CMakeLists.txt2
-rw-r--r--local_ads/pylocal_ads/CMakeLists.txt4
-rw-r--r--search/pysearch/CMakeLists.txt4
-rw-r--r--tracking/pytracking/CMakeLists.txt14
-rw-r--r--traffic/pytraffic/CMakeLists.txt1
7 files changed, 31 insertions, 2 deletions
diff --git a/generator/mwm_diff/pymwm_diff/CMakeLists.txt b/generator/mwm_diff/pymwm_diff/CMakeLists.txt
index 419d90eedf..e2ac838360 100644
--- a/generator/mwm_diff/pymwm_diff/CMakeLists.txt
+++ b/generator/mwm_diff/pymwm_diff/CMakeLists.txt
@@ -22,4 +22,8 @@ omim_link_libraries(
${LIBZ}
)
+if (PLATFORM_MAC)
+ omim_link_libraries(${PROJECT_NAME} "-Wl,-undefined,dynamic_lookup")
+endif()
+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
diff --git a/generator/pygen/CMakeLists.txt b/generator/pygen/CMakeLists.txt
index 5d94ce4c56..88a4a2a5a7 100644
--- a/generator/pygen/CMakeLists.txt
+++ b/generator/pygen/CMakeLists.txt
@@ -50,4 +50,8 @@ omim_link_libraries(
link_qt5_core(${PROJECT_NAME})
link_qt5_network(${PROJECT_NAME})
+if (PLATFORM_MAC)
+ omim_link_libraries(${PROJECT_NAME} "-Wl,-undefined,dynamic_lookup")
+endif()
+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
diff --git a/kml/pykmlib/CMakeLists.txt b/kml/pykmlib/CMakeLists.txt
index 47da2a952d..dfdb3b04d9 100644
--- a/kml/pykmlib/CMakeLists.txt
+++ b/kml/pykmlib/CMakeLists.txt
@@ -32,7 +32,7 @@ omim_link_libraries(
link_qt5_core(${PROJECT_NAME})
if (PLATFORM_MAC)
- omim_link_libraries(${PROJECT_NAME} ${LIBZ})
+ omim_link_libraries(${PROJECT_NAME} "-Wl,-undefined,dynamic_lookup")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
diff --git a/local_ads/pylocal_ads/CMakeLists.txt b/local_ads/pylocal_ads/CMakeLists.txt
index 46478a4c40..20fdad6a6b 100644
--- a/local_ads/pylocal_ads/CMakeLists.txt
+++ b/local_ads/pylocal_ads/CMakeLists.txt
@@ -16,4 +16,8 @@ omim_link_libraries(
base
)
+if (PLATFORM_MAC)
+ omim_link_libraries(${PROJECT_NAME} "-Wl,-undefined,dynamic_lookup")
+endif()
+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
diff --git a/search/pysearch/CMakeLists.txt b/search/pysearch/CMakeLists.txt
index 82ce67fa77..2a5916433e 100644
--- a/search/pysearch/CMakeLists.txt
+++ b/search/pysearch/CMakeLists.txt
@@ -39,4 +39,8 @@ omim_link_libraries(
link_qt5_core(${PROJECT_NAME})
link_qt5_network(${PROJECT_NAME})
+if (PLATFORM_MAC)
+ omim_link_libraries(${PROJECT_NAME} "-Wl,-undefined,dynamic_lookup")
+endif()
+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
diff --git a/tracking/pytracking/CMakeLists.txt b/tracking/pytracking/CMakeLists.txt
index 7a2e4adf14..1317dc66ae 100644
--- a/tracking/pytracking/CMakeLists.txt
+++ b/tracking/pytracking/CMakeLists.txt
@@ -9,5 +9,17 @@ include_directories(${CMAKE_BINARY_DIR})
omim_add_library(${PROJECT_NAME} MODULE ${SRC})
-omim_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} tracking coding geometry base)
+omim_link_libraries(
+ ${PROJECT_NAME}
+ ${Boost_LIBRARIES}
+ tracking
+ coding
+ geometry
+ base
+)
+
+if (PLATFORM_MAC)
+ omim_link_libraries(${PROJECT_NAME} "-Wl,-undefined,dynamic_lookup")
+endif()
+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
diff --git a/traffic/pytraffic/CMakeLists.txt b/traffic/pytraffic/CMakeLists.txt
index 362b7d3c53..3aee6bd7fa 100644
--- a/traffic/pytraffic/CMakeLists.txt
+++ b/traffic/pytraffic/CMakeLists.txt
@@ -14,6 +14,7 @@ if (PLATFORM_MAC)
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
"-framework QuartzCore"
+ "-Wl,-undefined,dynamic_lookup"
)
endif()