diff --git a/CMakeLists.txt b/CMakeLists.txt index d9375f7..b2ca95d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2) project(compilescript - VERSION 0.2.0 + VERSION 0.2.1 LANGUAGES CXX ) diff --git a/src/main.cpp b/src/main.cpp index 6f81ade..0dd3e28 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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))