|
1 | | - |
2 | | -function declare_old_library_product(product_name, product_soname) |
3 | | - return esc(quote |
4 | | - |
5 | | - end) |
6 | | -end |
7 | | - |
8 | | -function declare_new_library_product(product_name) |
9 | | - handle_name = Symbol(string(product_name, "_handle")) |
10 | | - get_path_name = Symbol(string("get_", product_name, "_path")) |
11 | | - path_name = Symbol(string(product_name, "_path")) |
12 | | -end |
13 | | - |
14 | 1 | macro declare_library_product(product_name, product_soname) |
15 | 2 | handle_name = Symbol(string(product_name, "_handle")) |
16 | 3 | get_path_name = Symbol(string("get_", product_name, "_path")) |
|
54 | 41 | macro init_library_product(product_name, product_path, dlopen_flags) |
55 | 42 | handle_name = Symbol(string(product_name, "_handle")) |
56 | 43 | path_name = Symbol(string(product_name, "_path")) |
| 44 | + preference_name = string(product_name, "_path") |
57 | 45 | return excat(quote |
58 | | - global $(path_name) = joinpath(artifact_dir, $(product_path)) |
| 46 | + global $(path_name) = @load_preference($(preference_name), joinpath(artifact_dir, $(product_path))) |
59 | 47 | # Manually `dlopen()` this right now so that future invocations |
60 | 48 | # of `ccall` with its path/SONAME will find this path immediately. |
61 | 49 | # dlopen_flags === nothing means to not dlopen the library. |
62 | 50 | if $(dlopen_flags) !== nothing |
63 | 51 | global $(handle_name) = dlopen($(path_name), $(dlopen_flags)) |
64 | | - push!(LIBPATH_list, joinpath(artifact_dir, $(dirname(product_path)))) |
| 52 | + push!(LIBPATH_list, dirname($(path_name))) |
65 | 53 | end |
66 | 54 | end, |
67 | 55 | init_new_library_product(product_name), |
|
0 commit comments