static char *offload_targets = NULL;
+#if OFFLOAD_DEFAULTED
+/* Set to true if -foffload has not been used and offload_targets
+ is set to the configured in default. */
+static bool offload_targets_default;
+#endif
+
/* Nonzero if cross-compiling.
When -b is used, the value comes from the `specs' file. */
/* If the user didn't specify any, default to all configured offload
targets. */
if (ENABLE_OFFLOADING && offload_targets == NULL)
- handle_foffload_option (OFFLOAD_TARGETS);
+ {
+ handle_foffload_option (OFFLOAD_TARGETS);
+#if OFFLOAD_DEFAULTED
+ offload_targets_default = true;
+#endif
+ }
if (output_file
&& strcmp (output_file, "-") != 0
obstack_grow (&collect_obstack, offload_targets,
strlen (offload_targets) + 1);
xputenv (XOBFINISH (&collect_obstack, char *));
+#if OFFLOAD_DEFAULTED
+ if (offload_targets_default)
+ xputenv ("OFFLOAD_TARGET_DEFAULT=1");
+#endif
}
free (offload_targets);