You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -48,9 +55,12 @@ Another required field is `make_precompiler_url`. It is a URL template to the ar
48
55
49
56
`@{artefact_filename}` in the URL template string will be replaced by corresponding artefact filenames when fetching them. For example, `cc_precompiler_example-nif-2.16-x86_64-linux-gnu-0.1.0.tar.gz`.
50
57
51
-
Note that there is an optional config key for elixir_make, `make_precompiler_filename`. If the name (file extension does not count) of the shared library is different from your app's name, then `make_precompiler_filename` should be set. For example, if the app name is `"cc_precompiler_example"` while the name shared library is `"nif.so"` (or `"nif.dll"` on windows), then `make_precompiler_filename` should be set as `"nif"`.
The first optional config key for elixir_make is `make_precompiler_filename`. If the name (file extension does not count) of the shared library is different from your app's name, then `make_precompiler_filename` should be set. For example, if the app name is `"cc_precompiler_example"` while the name shared library is `"nif.so"` (or `"nif.dll"` on windows), then `make_precompiler_filename` should be set as `"nif"`.
52
61
53
-
Another optional config key is `make_precompiler_priv_paths`. For example, say the `priv` directory is organised as follows in Linux, macOS and Windows respectively,
The second optional config key is `make_precompiler_priv_paths`. For example, say the `priv` directory is organised as follows in Linux, macOS and Windows respectively,
54
64
55
65
```
56
66
# Linux
@@ -93,6 +103,30 @@ Of course, wildcards (`?`, `**`, `*`) are supported when specifiying files. For
93
103
94
104
Directory structures and symbolic links are preserved.
If you'd like to aim for an older NIF version, say `2.15` for Erlang/OTP 23 and 24, then you need to setup CI correspondingly and set the value of this key to `[versions: ["2.15", "2.16"]]`. This optional key will only be checked when downloading precompiled artefacts.
115
+
116
+
For some platforms maybe we only have precompiled artefacts after a certain NIF version, say for x86_64 Windows we have precompiled artefacts available when NIF version >= `2.16` while other platforms have precompiled artefacts available from NIF version >= `2.15`.
117
+
118
+
In such case we can inform `:elixir_make` that Windows targets don't have precompiled artefacts available except for NIF version `2.16` by passing a function to the `availability` sub-key.
119
+
120
+
```elixir
121
+
defptarget_available_for_nif_version?(target, nif_version) do
122
+
ifString.contains?(target, "windows") do
123
+
nif_version =="2.16"
124
+
else
125
+
true
126
+
end
127
+
end
128
+
```
129
+
96
130
### (Optional) Customise Precompilation Targets
97
131
98
132
To override the default configuration, please set the `cc_precompile` key in `project`. For example,
0 commit comments