Skip to content

Commit b864673

Browse files
authored
Merge pull request #340 from igchor/macos_shared
Fix building UMF as shared library on MacOS
2 parents 2fec593 + 03f8387 commit b864673

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/basic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ jobs:
332332
-DUMF_BUILD_OS_MEMORY_PROVIDER=OFF
333333
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=OFF
334334
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
335+
-DUMF_BUILD_SHARED_LIBRARY=ON
335336
336337
- name: Build UMF
337338
run: cmake --build ${{env.BUILD_DIR}} -j $(sysctl -n hw.logicalcpu)
@@ -342,3 +343,4 @@ jobs:
342343
--build-dir ${{env.BUILD_DIR}}
343344
--install-dir ${{env.INSTL_DIR}}
344345
--build-type ${{env.BUILD_TYPE}}
346+
--shared-library

cmake/helpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function(add_umf_library)
114114

115115
if (WINDOWS)
116116
target_link_options(${ARG_NAME} PRIVATE /DEF:${ARG_WINDOWS_DEF_FILE})
117-
else()
117+
elseif(LINUX)
118118
target_link_options(${ARG_NAME} PRIVATE "-Wl,--version-script=${ARG_LINUX_MAP_FILE}")
119119
endif()
120120
endif()

test/test_installation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ def _create_match_list(self) -> List[str]:
6060
if platform.system() == "Windows":
6161
lib_ext_static = "lib"
6262
lib_ext_shared = "lib"
63-
else:
63+
elif platform.system() == "Linux":
6464
lib_ext_static = "a"
6565
lib_ext_shared = "so"
6666
lib_prefix = "lib"
67+
else: # MacOS
68+
lib_ext_static = "a"
69+
lib_ext_shared = "dylib"
70+
lib_prefix = "lib"
6771

6872
bin = []
6973
if platform.system() == "Windows" and self.shared_library:

0 commit comments

Comments
 (0)