Brad King <[email protected]> wrote: > The original issue could have been worded to explain that nasm/yasm > dependencies are not handled correctly, so I'd like to treat it that > way.
OK. > If these tools have the -M flag then a "deptype = gcc" code path > should work. yasm has an -M flag that causes it to write the dependencies to stdout WITHOUT doing the assembly. nasm additionally has -MD <file>, which causes it to write the dependencies to <file> AND do the assembly. yasm does NOT have -MD. I don't see how to make CMake execute yasm -M -o <x>.obj <x>.asm > $DEP_FILE and then execute yasm -o <x>.obj <x>.asm to do the actual assembly. Instead, I decided to try to add -MD to yasm. See the attached patch, which is a very rough draft. > The usingMSVC boolean should be updated to be false > for lang != C|CXX|RC so that the "else" code path is taken. Then > > CMAKE_DEPFILE_FLAGS_<LANG> > > should be added to the platform modules for these toolchains. I think I understood what you meant, and I've attached a patch that does that. With my patch, cmake -GNinja generates a rule like this: rule ASM_NASM_COMPILER depfile = $DEP_FILE deps = gcc command = c:\<path-to-yasm>yasm.exe $FLAGS -MD $DEP_FILE -f win32 -o $out $in description = Building ASM_NASM object $out That looks right to me. But, when I execute ninja and it executes the rule, it never provides a value for $DEP_FILE. Instead, the executed command looks like this: 10/358] Building ASM_NASM object cryp...\CMakeFiles\sha.dir\sha512-586.asm.obj FAILED: c:\<path-to-yasm>\yasm.exe -I..\crypto\. -I..\crypto\..\include -I..\crypto\sha\. -I..\crypto\sha\.. -I..\crypto\sha\..\..\include -MD -f win32 -o crypto\sha\CMakeFiles\sha.dir\sha512-586.asm.obj crypto\sh \sha512-586.asm asm: option `-MD' needs an argument! Notice that the empty string was substituted for $DEP_FILE. It seems like solving this requires more understanding of how CMake works than I currently have. Any ideas? Thanks for your help on this. Cheers, Brian
0001-Add-an-MD-option-for-generating-dependency-file-duri.patch
Description: Binary data
0001-Fix-dependency-generation-for-ASM_NASM-Ninja.patch
Description: Binary data
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
