diff --git a/src/fontations/Cargo.toml b/src/fontations/Cargo.toml index 67a11b6a3..126478214 100644 --- a/src/fontations/Cargo.toml +++ b/src/fontations/Cargo.toml @@ -14,4 +14,4 @@ libc = "0.2" [lib] name = "harfbuzz_fontations" path = "lib.rs" -crate-type = ["cdylib"] +crate-type = ["staticlib"] diff --git a/src/fontations/meson.build b/src/fontations/meson.build index da07bb3e9..8c21358f8 100644 --- a/src/fontations/meson.build +++ b/src/fontations/meson.build @@ -10,10 +10,10 @@ hb_rs = rust.bindgen( cargo = find_program('cargo') -libharfbuzz_fontations = custom_target( +harfbuzz_fontations = custom_target( 'harfbuzz_fontations', input: ['lib.rs'], - output: ['libharfbuzz_fontations.so'], + output: ['libharfbuzz_fontations.a'], depends: [hb_rs], env: ['OUT_DIR=' + meson.current_build_dir()], command: [ @@ -30,5 +30,5 @@ libharfbuzz_fontations = custom_target( ) harfbuzz_fontations_dep = declare_dependency( - link_with: libharfbuzz_fontations, + link_with: harfbuzz_fontations, ) diff --git a/src/meson.build b/src/meson.build index 6612f7988..1ceaa98fd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -453,6 +453,7 @@ hb_sources = hb_base_sources + hb_base_ragel_generated_sources hb_headers = hb_base_headers harfbuzz_deps = [thread_dep, m_dep] + harfbuzz_extra_deps +harfbuzz_link_args = [] if get_option('with_libstdcxx') chosen_linker = 'cpp' @@ -523,6 +524,7 @@ if conf.get('HAVE_FONTATIONS', 0) == 1 hb_sources += hb_fontations_sources hb_headers += hb_fontations_headers harfbuzz_deps += [harfbuzz_fontations_dep] + harfbuzz_link_args += ['-Wl,--whole-archive', '-L' + meson.current_build_dir() + '/fontations', '-lharfbuzz_fontations', '-Wl,--no-whole-archive'] endif have_icu = conf.get('HAVE_ICU', 0) == 1 @@ -610,6 +612,7 @@ darwin_versions = [hb_version_int, '@0@.0.0'.format(hb_version_int)] libharfbuzz = library('harfbuzz', hb_sources, include_directories: incconfig, dependencies: harfbuzz_deps, + link_args: harfbuzz_link_args, cpp_args: cpp_args + extra_hb_cpp_args, soversion: hb_so_version, version: version,