diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b22101b7..6e79e7cc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,8 +98,8 @@ jobs: install: git binutils mingw-w64-x86_64-clang mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-python - shell: msys2 {0} run: | - pacman --noconfirm -U https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-llvm-17.0.2-1-any.pkg.tar.zst - pacman --noconfirm -U https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-lld-17.0.2-1-any.pkg.tar.zst + pacman --noconfirm -U https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-llvm-17.0.4-any.pkg.tar.zst + pacman --noconfirm -U https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-lld-17.0.4-any.pkg.tar.zst - name: CMake run: | cmake -B build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} diff --git a/src/compiler/compiler.c b/src/compiler/compiler.c index e89d86d09..fa6473292 100644 --- a/src/compiler/compiler.c +++ b/src/compiler/compiler.c @@ -486,6 +486,10 @@ void compiler_compile(void) if (output_exe) { + if (file_is_dir(output_exe)) + { + error_exit("Cannot create exe with the name '%s' - there is already a directory with that name.", output_exe); + } if (link_libc() && platform_target.os != OS_TYPE_WIN32 && active_target.arch_os_target == default_target && active_target.system_linker != SYSTEM_LINKER_OFF) { @@ -520,6 +524,10 @@ void compiler_compile(void) } else if (output_static) { + if (file_is_dir(output_static)) + { + error_exit("Cannot create a static library with the name '%s' - there is already a directory with that name.", output_exe); + } if (!static_lib_linker(output_static, obj_files, output_file_count)) { error_exit("Failed to produce static library '%s'.", output_static); @@ -531,9 +539,13 @@ void compiler_compile(void) } else if (output_dynamic) { + if (file_is_dir(output_dynamic)) + { + error_exit("Cannot create a dynamic library with the name '%s' - there is already a directory with that name.", output_exe); + } if (!dynamic_lib_linker(output_dynamic, obj_files, output_file_count)) { - error_exit("Failed to produce static library '%s'.", output_dynamic); + error_exit("Failed to produce dynamic library '%s'.", output_dynamic); } delete_object_files(obj_files, output_file_count); printf("Dynamic library '%s' created.\n", output_dynamic); diff --git a/src/version.h b/src/version.h index 4364c0a92..4e9a7681d 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define COMPILER_VERSION "0.4.693" +#define COMPILER_VERSION "0.4.694"