@@ -153,30 +153,36 @@ Executable::Executable(const DefaultExecutable& default_executable) {
153
153
154
154
this ->path = default_paths.executable_path ;
155
155
156
- for (std:: size_t i = 0 , n = default_executable.options .size (); i < n; ++i ) {
156
+ if ( default_executable.options .empty () ) {
157
157
ExecutableOptions options;
158
- options.label = default_executable.options [i].label ;
159
- if (default_executable.options [i].working_folder .Empty ()) {
160
- options.working_folder = default_paths.working_folder ;
161
- } else {
162
- options.working_folder = default_executable.options [i].working_folder ;
163
- }
164
- options.args = SplitSpace (default_executable.options [i].args );
165
- options.envs = SplitSpace (default_executable.options [i].envs );
166
-
167
- // On all operating systems, but Windows we keep running into problems with this ending up
168
- // somewhere the user isn't allowed to create and write files. For consistncy sake, the log
169
- // initially will be set to the users home folder across all OS's. This is highly visible
170
- // in the application launcher and should not present a usability issue. The developer can
171
- // easily change this later to anywhere they like.
158
+ options.label = " Default Options" ;
159
+ options.working_folder = default_paths.working_folder ;
172
160
options.log_file = std::string (" ${VULKAN_HOME}/" ) + default_executable.name + " .txt" ;
173
-
174
161
this ->options_list .push_back (options);
162
+ } else {
163
+ for (std::size_t i = 0 , n = default_executable.options .size (); i < n; ++i) {
164
+ ExecutableOptions options;
165
+ options.label = default_executable.options [i].label ;
166
+ if (default_executable.options [i].working_folder .Empty ()) {
167
+ options.working_folder = default_paths.working_folder ;
168
+ } else {
169
+ options.working_folder = default_executable.options [i].working_folder ;
170
+ }
171
+ options.args = SplitSpace (default_executable.options [i].args );
172
+ options.envs = SplitSpace (default_executable.options [i].envs );
173
+
174
+ // On all operating systems, but Windows we keep running into problems with this ending up
175
+ // somewhere the user isn't allowed to create and write files. For consistncy sake, the log
176
+ // initially will be set to the users home folder across all OS's. This is highly visible
177
+ // in the application launcher and should not present a usability issue. The developer can
178
+ // easily change this later to anywhere they like.
179
+ options.log_file = std::string (" ${VULKAN_HOME}/" ) + default_executable.name + " .txt" ;
175
180
176
- if (i == 0 ) {
177
- this ->active_options = options.label ;
181
+ this ->options_list .push_back (options);
178
182
}
179
183
}
184
+
185
+ this ->active_options = this ->options_list [0 ].label ;
180
186
}
181
187
182
188
Executable::Executable (const Path& executable_path) {
0 commit comments