@@ -110,10 +110,9 @@ bool Main(const fml::CommandLine& command_line) {
110
110
111
111
auto spriv_file_name = std::filesystem::absolute (
112
112
std::filesystem::current_path () / switches.spirv_file_name );
113
- if (!fml::WriteAtomically (
114
- *switches.working_directory ,
115
- reinterpret_cast <const char *>(spriv_file_name.u8string ().c_str ()),
116
- *compiler.GetSPIRVAssembly ())) {
113
+ if (!fml::WriteAtomically (*switches.working_directory ,
114
+ Utf8FromPath (spriv_file_name).c_str (),
115
+ *compiler.GetSPIRVAssembly ())) {
117
116
std::cerr << " Could not write file to " << switches.spirv_file_name
118
117
<< std::endl;
119
118
return false ;
@@ -144,10 +143,9 @@ bool Main(const fml::CommandLine& command_line) {
144
143
std::cerr << " Runtime stage data could not be created." << std::endl;
145
144
return false ;
146
145
}
147
- if (!fml::WriteAtomically (*switches.working_directory , //
148
- reinterpret_cast <const char *>(
149
- sl_file_name.u8string ().c_str ()), //
150
- *stage_data_mapping //
146
+ if (!fml::WriteAtomically (*switches.working_directory , //
147
+ Utf8FromPath (sl_file_name).c_str (), //
148
+ *stage_data_mapping //
151
149
)) {
152
150
std::cerr << " Could not write file to " << switches.sl_file_name
153
151
<< std::endl;
@@ -159,10 +157,9 @@ bool Main(const fml::CommandLine& command_line) {
159
157
return false ;
160
158
}
161
159
} else {
162
- if (!fml::WriteAtomically (
163
- *switches.working_directory ,
164
- reinterpret_cast <const char *>(sl_file_name.u8string ().c_str ()),
165
- *compiler.GetSLShaderSource ())) {
160
+ if (!fml::WriteAtomically (*switches.working_directory ,
161
+ Utf8FromPath (sl_file_name).c_str (),
162
+ *compiler.GetSLShaderSource ())) {
166
163
std::cerr << " Could not write file to " << switches.sl_file_name
167
164
<< std::endl;
168
165
return false ;
@@ -176,8 +173,7 @@ bool Main(const fml::CommandLine& command_line) {
176
173
std::filesystem::current_path () / switches.reflection_json_name );
177
174
if (!fml::WriteAtomically (
178
175
*switches.working_directory ,
179
- reinterpret_cast <const char *>(
180
- reflection_json_name.u8string ().c_str ()),
176
+ Utf8FromPath (reflection_json_name).c_str (),
181
177
*compiler.GetReflector ()->GetReflectionJSON ())) {
182
178
std::cerr << " Could not write reflection json to "
183
179
<< switches.reflection_json_name << std::endl;
@@ -191,8 +187,7 @@ bool Main(const fml::CommandLine& command_line) {
191
187
switches.reflection_header_name .c_str ());
192
188
if (!fml::WriteAtomically (
193
189
*switches.working_directory ,
194
- reinterpret_cast <const char *>(
195
- reflection_header_name.u8string ().c_str ()),
190
+ Utf8FromPath (reflection_header_name).c_str (),
196
191
*compiler.GetReflector ()->GetReflectionHeader ())) {
197
192
std::cerr << " Could not write reflection header to "
198
193
<< switches.reflection_header_name << std::endl;
@@ -205,8 +200,7 @@ bool Main(const fml::CommandLine& command_line) {
205
200
std::filesystem::absolute (std::filesystem::current_path () /
206
201
switches.reflection_cc_name .c_str ());
207
202
if (!fml::WriteAtomically (*switches.working_directory ,
208
- reinterpret_cast <const char *>(
209
- reflection_cc_name.u8string ().c_str ()),
203
+ Utf8FromPath (reflection_cc_name).c_str (),
210
204
*compiler.GetReflector ()->GetReflectionCC ())) {
211
205
std::cerr << " Could not write reflection CC to "
212
206
<< switches.reflection_cc_name << std::endl;
@@ -234,10 +228,9 @@ bool Main(const fml::CommandLine& command_line) {
234
228
}
235
229
auto depfile_path = std::filesystem::absolute (
236
230
std::filesystem::current_path () / switches.depfile_path .c_str ());
237
- if (!fml::WriteAtomically (
238
- *switches.working_directory ,
239
- reinterpret_cast <const char *>(depfile_path.u8string ().c_str ()),
240
- *compiler.CreateDepfileContents ({result_file}))) {
231
+ if (!fml::WriteAtomically (*switches.working_directory ,
232
+ Utf8FromPath (depfile_path).c_str (),
233
+ *compiler.CreateDepfileContents ({result_file}))) {
241
234
std::cerr << " Could not write depfile to " << switches.depfile_path
242
235
<< std::endl;
243
236
return false ;
0 commit comments