Replicate the full path of the original file under cache_dir.
the build was successful Details

Fixes #1
This commit is contained in:
tastytea 2018-12-30 03:14:32 +01:00
parent 3e39846c15
commit 711accdc8f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.2)
project(compilescript
VERSION 0.2.0
VERSION 0.2.1
LANGUAGES CXX
)

View File

@ -93,10 +93,11 @@ int main(int argc, char *argv[])
return 1;
}
const fs::path original(argv[1]);
const fs::path source = cache_dir / original.filename();
const fs::path original = fs::canonical(argv[1]);
const fs::path source = cache_dir / original;
const fs::path binary = (source.string() + ".bin");
string compiler_arguments;
fs::create_directories(binary.parent_path());
if (!fs::exists(binary) ||
fs::last_write_time(original) > fs::last_write_time(binary))