   defp make_build_mode_flag(args, :release), do: args ++ ["--release"]
   defp make_build_mode_flag(args, :debug), do: args
 
+  defp get_target_os_type(nil) do
+    :os.type()
+  end
+
   defp get_target_os_type(target) when is_binary(target) do
     case target do
       "aarch64-apple-darwin" -> {:unix, :darwin}


  defp make_file_names(base_name, :lib, target) do
    suffix = get_suffix(target, :lib)
    case get_target_os_type(target) do
      {:win32, _} -> {"#{base_name}.#{suffix}", "lib#{base_name}.dll"}
      {:unix, :darwin} -> {"lib#{base_name}.#{suffix}", "lib#{base_name}.so"}


    output_dir =
      if is_binary(target) do
        Path.join([target, Atom.to_string(config.mode)])
      else
        Atom.to_string(config.mode)
      end
