From b2c6274f7453ccdef7895bc41459b5af216beace Mon Sep 17 00:00:00 2001 From: meisl Date: Sat, 17 Jul 2021 12:40:50 +0200 Subject: [PATCH] * fix #54 / step 3: avoid some (= not all) complaints re the .binary filename 64tass still had/has. Actually, I don't quite understand why it still says "not the real name of the file". The 64tass docs say: > -Wno-portable > Don't warn about source portability problems. > These cross platform development annoyances are checked for: > * Case insensitive use of file names or use of short names. > * Use of backslashes for path separation instead of forward slashes. > * Use of reserved characters in file names. > * Absolute paths --- compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt | 4 +++- compiler/test/TestCompilerOnImportsAndIncludes.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt b/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt index 2a4b30b58..27ca32e1a 100644 --- a/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt +++ b/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt @@ -1327,9 +1327,11 @@ $repeatLabel lda $counterVar val sourcePath = stmt.definingModule().source // FIXME: %asmbinary inside non-library, non-filesystem module val includedPath = sourcePath.resolveSibling(includedName) - val pathForAssembler = outputDir // 64tass needs the path *relative to the .asm file* + val pathForAssembler = outputDir // #54: 64tass needs the path *relative to the .asm file* .absolute() // avoid IllegalArgumentExc due to non-absolute path .relativize(absolute path) .relativize(includedPath) + .normalize() // avoid assembler warnings (-Wportable; only some, not all) + .toString().replace('\\', '/') out(" .binary \"$pathForAssembler\" $offset $length") } "%breakpoint" -> { diff --git a/compiler/test/TestCompilerOnImportsAndIncludes.kt b/compiler/test/TestCompilerOnImportsAndIncludes.kt index e67600783..d166f92d3 100644 --- a/compiler/test/TestCompilerOnImportsAndIncludes.kt +++ b/compiler/test/TestCompilerOnImportsAndIncludes.kt @@ -117,7 +117,7 @@ class TestCompilerOnImportsAndIncludes { dynamicTest(displayName) { assumeReadableFile(p8Path) assumeReadableFile(binPath) - assertNotEquals( // the bug we're testing for (#??) was hidden if outputDir == workinDir + assertNotEquals( // the bug we're testing for (#54) was hidden if outputDir == workinDir workingDir.normalize().toAbsolutePath(), outputDir.normalize().toAbsolutePath(), "sanity check: workingDir and outputDir should not be the same folder")