[CMake] [EXTERNAL]: Errors with cmake for VS2105 (update 3) + clang + nmake

Parag Chandra parag at ionicsecurity.com
Mon Nov 21 13:02:42 EST 2016


Hi Peter,

Seems like CMake is continuing to pass cmd line args that are only suitable for the default msvc compiler, which clang is treating as invalid paths. You need to override more than just the C_COMPILER. Try the instructions here:

http://stackoverflow.com/questions/38171878/how-do-i-tell-cmake-to-use-clang-on-windows

 

Parag Chandra
Technical Lead, Mobile Team
Mobile: +1.919.824.1410

Ionic Security Inc.
1170 Peachtree St. NE STE 400, Atlanta, GA 30309
 

On 11/21/16, 12:33 PM, "CMake on behalf of Peter Jansen" <cmake-bounces at cmake.org on behalf of p.jansen at computer.org> wrote:

    I am trying to use cmake to generate a "Nmake Makefiles" project in a Windows
    10 VS2015 (update 3) environment using the VS2015 clang compiler (which is
    the MS Clang/C2 compiler, version 3.8.0), but in doing so receive these
    errors :
    
    C:\Qsync\Source\Hello_World_C\build\clang_x64_nmake>cmake -G "NMake
    Makefiles" ..\.. -DCMAKE_C_COMPILER:FILEPATH="C:\Program Files
    (x86)\Microsoft Visual Studio 14.0\VC\ClangC2\bin\amd64\clang.exe"
    -DCMAKE_CXX_COMPILER:FILEPATH="C:\Program Files (x86)\Microsoft Visual
    Studio 14.0\VC\ClangC2\bin\amd64\clang.exe"
    -- The C compiler identification is Clang 3.8.0
    -- The CXX compiler identification is Clang 3.8.0
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
    Studio 14.0/VC/ClangC2/bin/amd64/clang.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
    Studio 14.0/VC/ClangC2/bin/amd64/clang.exe -- b
    roken
    CMake Error at C:/Program
    Files/CMake/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (message):
      The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
      14.0/VC/ClangC2/bin/amd64/clang.exe" is not able to compile a simple test
      program.
    
      It fails with the following output:
    
       Change Dir:
    C:/Qsync/Source/Hello_World_C/build/clang_x64_nmake/CMakeFiles/CMakeTmp
    
    
    
      Run Build Command:"nmake" "/NOLOGO" "cmTC_6a3b7\fast"
    
            "C:\Program Files (x86)\Microsoft Visual Studio
      14.0\VC\BIN\amd64\nmake.exe" -f CMakeFiles\cmTC_6a3b7.dir\build.make
      /nologo -L CMakeFiles\cmTC_6a3b7.dir\build
    
      Building C object CMakeFiles/cmTC_6a3b7.dir/testCCompiler.c.obj
    
            C:\PROGRA~2\MICROS~1.0\VC\ClangC2\bin\amd64\clang.exe
      @C:\Users\Peter\AppData\Local\Temp\nm1768.tmp
    
      clang.exe: error: no such file or directory: '/nologo'
    
      clang.exe: error: no such file or directory: '/DWIN32'
    
      clang.exe: error: no such file or directory: '/D_WINDOWS'
    
      clang.exe: error: no such file or directory: '/W3'
    
      clang.exe: error: no such file or directory: '/D_DEBUG'
    
      clang.exe: error: no such file or directory: '/MDd'
    
      clang.exe: error: no such file or directory: '/Zi'
    
      clang.exe: error: no such file or directory: '/Ob0'
    
      clang.exe: error: no such file or directory: '/Od'
    
      clang.exe: error: no such file or directory: '/RTC1'
    
      clang.exe: error: no such file or directory:
      '/FoCMakeFiles\cmTC_6a3b7.dir\testCCompiler.c.obj'
    
      clang.exe: error: no such file or directory: '/FdCMakeFiles\cmTC_6a3b7.dir
      -c'
    
      NMAKE : fatal error U1077:
      'C:\PROGRA~2\MICROS~1.0\VC\ClangC2\bin\amd64\clang.exe' : return code
      '0x1'
    
      Stop.
    
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
    Studio
      14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
    
      Stop.
    
    
    
    
    
      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:1 (project)
    
    
    -- Configuring incomplete, errors occurred!
    See also
    "C:/Qsync/Source/Hello_World_C/build/clang_x64_nmake/CMakeFiles/CMakeOutput.log".
    See also
    "C:/Qsync/Source/Hello_World_C/build/clang_x64_nmake/CMakeFiles/CMakeError.log".
    
    
    
    I might be doing something wrong, as I am quite new to cmake, although I got
    the above clang to work for a regular "Visual Studio 15 Win64" generated
    project (Hello_World.c  , i.e. the minimal C program). Or is this a known
    problem or not even supported combination with nmake ?
    
    Any help will be very much appreciated.
    
    Peter Jansen
    
    
    
    --
    View this message in context: http://cmake.3232098.n2.nabble.com/Errors-with-cmake-for-VS2105-update-3-clang-nmake-tp7594637.html
    Sent from the CMake mailing list archive at Nabble.com.
    -- 
    
    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
    



More information about the CMake mailing list