VS/NASM: Same source filename outputs to same OBJ file and directory
Using CMake 3.24.2 and NASM 2.15.05. Running Windows 10 Pro 21H2 19044.2130. Attempted to build using "Visual Studio 2019 Community" generator targeting x86.
Target contains C, CXX, and NASM files. C and CXX source files with the same filename, but different parent directories are able to successfully build into different intermediate object file directories. There is no problem there. However, NASM files that share same filename, but different parent directories do not build into different intermediate object directories, and end up overriding each other. This causes the linker to fail due to missing function definitions.
Example:
project
|- foo
|- a.c
|- b.asm
|- bar
|- a.c
|- b.asm
In this example, foo/a.c and bar/a.c compile to obj files to different directories. However, foo/b.asm and bar/b.asm compile to obj files in the same directory.