RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
199 stars 42 forks source link

Set PDB_NAME to something other than asar #247

Closed Atari2 closed 2 years ago

Atari2 commented 2 years ago

CMake was automatically setting the PDB_NAME to be asar.pdb, which on Windows conflicts with the dlls pdb name, since it's the same (asar.dll -> asar.pdb). This was giving arcane linker errors since it was trying to write the same file at the same time from 2 places and it completely broke debugging on Visual Studio, since it wasn't loading the debug symbols. Setting the PDB_NAME alone works fine, symbols load correctly and there are no linker errors. This was also tested on Linux to confirm that it works just fine, cmake just ignores the property but doesn't complain.

RPGHacker commented 2 years ago

Oh, whoops! Of course the rename had to break something! 🙃 But does that really work? I thought most debuggers always just looked for a .pdb file with a matching name as the .exe?

Atari2 commented 2 years ago

Yeah it works just fine image

RPGHacker commented 2 years ago

Interesting, I never knew. 👀 I suppose the compiler bakes the .pdb file name into the .exe then or something.

Anyways, could we adjust the name slightly? I'm thinking of

set_target_properties(asar-standalone PROPERTIES PDB_NAME "asar.exe")

for the executable and

set_target_properties(asar PROPERTIES PDB_NAME "asar.dll")

for the lib. That should give us file names like asar.exe.pdb and asar.dll.pdb, which should hopefully avoid any confusion. I think I kinda prefer that over having one of the .pdb files just named asar.pdb.

If you do that, I'll merge the PR (or alternatively I can just quickly do it myself, if you prefer that).

Atari2 commented 2 years ago

Done :)

RPGHacker commented 2 years ago

Neat, thanks!