Browse Source

Fixed MinGW test.

Бранимир Караџић 1 year ago
parent
commit
f6673d5bf4
3 changed files with 7 additions and 8 deletions
  1. 2 2
      scripts/toolchain.lua
  2. 5 1
      src/file.cpp
  3. 0 5
      tests/filepath_test.cpp

+ 2 - 2
scripts/toolchain.lua

@@ -623,12 +623,12 @@ function toolchain(_buildDir, _libDir)
 			"MINGW_HAS_SECURE_API=1",
 			"MINGW_HAS_SECURE_API=1",
 		}
 		}
 		buildoptions {
 		buildoptions {
+			"-Wa,-mbig-obj",
+			"-Wundef",
 			"-Wunused-value",
 			"-Wunused-value",
 			"-fdata-sections",
 			"-fdata-sections",
 			"-ffunction-sections",
 			"-ffunction-sections",
 			"-msse4.2",
 			"-msse4.2",
-			"-Wunused-value",
-			"-Wundef",
 		}
 		}
 		linkoptions {
 		linkoptions {
 			"-Wl,--gc-sections",
 			"-Wl,--gc-sections",

+ 5 - 1
src/file.cpp

@@ -865,14 +865,18 @@ namespace bx
 			return false;
 			return false;
 		}
 		}
 
 
-#if BX_CRT_MSVC
+#if BX_CRT_MSVC || BX_CRT_MINGW
 		int32_t result = -1;
 		int32_t result = -1;
 		FileInfo fi;
 		FileInfo fi;
 		if (stat(fi, _filePath) )
 		if (stat(fi, _filePath) )
 		{
 		{
 			if (FileType::Dir == fi.type)
 			if (FileType::Dir == fi.type)
 			{
 			{
+#	if BX_CRT_MINGW
+				result = ::rmdir(_filePath.getCPtr() );
+#	else
 				result = ::_rmdir(_filePath.getCPtr() );
 				result = ::_rmdir(_filePath.getCPtr() );
+#	endif // BX_CRT_MINGW
 			}
 			}
 			else
 			else
 			{
 			{

+ 0 - 5
tests/filepath_test.cpp

@@ -130,11 +130,6 @@ TEST_CASE("FilePath temp", "[filepath]")
 	tmp.join("bx.test/abvgd/555333/test");
 	tmp.join("bx.test/abvgd/555333/test");
 	REQUIRE(bx::makeAll(tmp, bx::ErrorAssert{}) );
 	REQUIRE(bx::makeAll(tmp, bx::ErrorAssert{}) );
 
 
-	if (BX_ENABLED(BX_CRT_MINGW) )
-	{
-		SKIP("bx::removeAll fails on GHA MinGW container.");
-	}
-
 	tmp.set(bx::Dir::Temp);
 	tmp.set(bx::Dir::Temp);
 	tmp.join("bx.test");
 	tmp.join("bx.test");
 	REQUIRE(bx::removeAll(tmp, bx::ErrorAssert{}) );
 	REQUIRE(bx::removeAll(tmp, bx::ErrorAssert{}) );