@@ -196,29 +196,30 @@ void ReflectionParser::GenerateFiles(void)
196
196
197
197
moduleFilesData << moduleFileData;
198
198
199
- // if the generated file header doesn't exist, we need to regenerate
200
- if (m_options.forceRebuild || !metaCacheFileExists || !exists ( outputFileHeader ))
199
+ // if the generated file header/source doesn't exist, we need to regenerate
200
+ if (m_options.forceRebuild ||
201
+ !metaCacheFileExists ||
202
+ !exists ( outputFileHeader ) ||
203
+ !exists ( outputFileSource )
204
+ )
201
205
{
202
206
generateModuleFile ( outputFileHeader, outputFileSource, file.first , file.second );
203
207
204
208
continue ;
205
209
}
206
210
207
211
auto lastSourceWrite = last_write_time ( filePath );
208
- auto lastGeneratedWrite = last_write_time ( outputFileHeader );
212
+ auto lastGeneratedHeaderWrite = last_write_time ( outputFileHeader );
213
+ auto lastGeneratedSourceWrite = last_write_time ( outputFileSource );
209
214
210
215
// if the generated file is older than the source file, we need to regenerate
211
- if (lastSourceWrite > lastGeneratedWrite )
216
+ if (lastSourceWrite > lastGeneratedHeaderWrite || lastSourceWrite > lastGeneratedSourceWrite )
212
217
generateModuleFile ( outputFileHeader, outputFileSource, file.first , file.second );
213
218
}
214
219
215
- fs::path moduleCacheFileName = m_options.outputModuleFileDirectory ;
216
-
217
- moduleCacheFileName /= " .meta-cache" ;
218
-
219
220
if (!m_options.forceRebuild && metaCacheFileExists)
220
221
{
221
- std::ifstream cacheFile ( moduleCacheFileName .string ( ) );
222
+ std::ifstream cacheFile ( metaCacheFileName .string ( ) );
222
223
223
224
std::istreambuf_iterator<char > cacheFileBegin ( cacheFile );
224
225
std::istreambuf_iterator<char > cacheFileEnd ( nullptr );
@@ -235,7 +236,7 @@ void ReflectionParser::GenerateFiles(void)
235
236
236
237
// update the cache
237
238
utils::WriteText (
238
- moduleCacheFileName .string ( ),
239
+ metaCacheFileName .string ( ),
239
240
moduleFileCache
240
241
);
241
242
0 commit comments