MantisBT - CMake
View Issue Details
0015253CMakeCMakepublic2014-11-16 21:132015-06-01 08:38
karlhungus 
 
normalmajoralways
closedfixed 
AMD64Windows8.1 Pro
CMake 3.0.2 
CMake 3.2 
0015253: Ninja generator causes build failure for ASM files via NASM
On Windows (haven't tested on other platforms), the Ninja generator for ASM files compiled with NASM adds the "/showIncludes" flag to the NASM command line in "rules.ninja":

    #############################################
    # Rule for compiling ASM_NASM files.

    rule ASM_NASM_COMPILER
      deps = msvc
      command = C:\dev\bin\nasm.exe $FLAGS /showIncludes -f win64 -o $out $in
      description = Building ASM_NASM object $out

This causes a build failure with the error message:

"nasm: error: more than one input file specified"

Using YASM instead of NASM turns this into a warning instead of an error, but inconvenient nonetheless.

Removing "/showIncludes" from the above line in "rules.ninja" fixes the error.
# Have nasm.exe in path #
git clone https://boringssl.googlesource.com/boringssl [^]
mkdir build
cd build
cmake -GNinja ..
ninja
No tags attached.
patch 0001-Ninja-Pass-only-the-flags-relevant-to-the-language.patch (1,923) 2015-01-28 07:33
https://public.kitware.com/Bug/file/5367/0001-Ninja-Pass-only-the-flags-relevant-to-the-language.patch
Issue History
2014-11-16 21:13karlhungusNew Issue
2015-01-28 07:33Brian SmithFile Added: 0001-Ninja-Pass-only-the-flags-relevant-to-the-language.patch
2015-01-28 07:34Brian SmithNote Added: 0037848
2015-01-28 08:48Brad KingNote Added: 0037849
2015-01-30 10:17Brad KingNote Added: 0037868
2015-01-30 10:18Brad KingStatusnew => resolved
2015-01-30 10:18Brad KingResolutionopen => fixed
2015-01-30 10:18Brad KingFixed in Version => CMake 3.2
2015-06-01 08:38Robert MaynardNote Added: 0038864
2015-06-01 08:38Robert MaynardStatusresolved => closed

Notes
(0037848)
Brian Smith   
2015-01-28 07:34   
The patch I just attached fixes the issue for me so that BoringSSL builds successfully without warnings from yasm.
(0037849)
Brad King   
2015-01-28 08:48   
Re 0015253:0037848: Thanks. For reference, the mailing list discussion of the patch is here:

 [PATCH for bug 15253] Ninja: Pass only the flags relevant to the language.
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/12246 [^]
(0037868)
Brad King   
2015-01-30 10:17   
This should fix it:

 Ninja: Use "deps = msvc" only for C and CXX
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a93d3ea [^]
(0038864)
Robert Maynard   
2015-06-01 08:38   
Closing resolved issues that have not been updated in more than 4 months.