Executable Compiler will now correctly create a directory if it does not exist when compiling a package using gcc

This commit is contained in:
netkas 2024-10-13 12:31:51 -04:00
parent 3b5a3882f6
commit 771748636d
2 changed files with 7 additions and 0 deletions

View file

@ -21,6 +21,7 @@ This update introduces minor bug fixes & improvements
### Fixed ### Fixed
- ncc will now correctly handle package execution where the main unit is not defined in the package instead of - ncc will now correctly handle package execution where the main unit is not defined in the package instead of
throwing an exception. throwing an exception.
- Executable Compiler will now correctly create a directory if it does not exist when compiling a package using gcc

View file

@ -84,6 +84,12 @@
$binary_path = ConstantCompiler::compileConstants($this->getProjectManager()->getProjectConfiguration(), $configuration->getOutput()); $binary_path = ConstantCompiler::compileConstants($this->getProjectManager()->getProjectConfiguration(), $configuration->getOutput());
} }
// Create the directory recursively if it does not exist
if(!is_dir(dirname($binary_path)))
{
mkdir(dirname($binary_path), 0777, true);
}
if($gcc_path === null) if($gcc_path === null)
{ {
throw new BuildException("Unable to find gcc executable, please make sure it is installed and in your PATH environment variable."); throw new BuildException("Unable to find gcc executable, please make sure it is installed and in your PATH environment variable.");