Hello

I found a bug that cmake doesn't create 'rules.ninja' while the build process even though generated build.ninja has a line "include rules.ninja".


Then running with -G Ninja fails with VS2017.

cmake ver 3.7.1 doesn't happen
.
cmake ver 3.9.1 happens.
cmake bb3647060cd8ddc4184687b64469d6a8554f49b3 happens.



I found this for llvm first, but it happens with the other projects.

example: HelloWorld in https://github.com/m-tmatma/cmake-sample.git

HelloWorld is a very simple cmake project.

This commands can reproduce this.
----------------------------------------------------------------
git clone https://github.com/m-tmatma/cmake-sample.git
mkdir cmake-sample\HelloWorld\Build
cd    cmake-sample\HelloWorld\Build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
cmake.exe -G Ninja ..
----------------------------------------------------------------

This is the output of cmake bb3647060cd8ddc4184687b64469d6a8554f49b3.
-------------------------------------------------------------------
-- The C compiler identification is MSVC 19.11.25506.0
-- The CXX compiler identification is MSVC 19.11.25506.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe -- broken CMake Error at C:/gitwork/GitHub/cmake/cmake-tmatma/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual

Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe" is
  not able to compile a simple test program.

  It fails with the following output:

Change Dir: C:/gitwork/test/test/cmake-sample/HelloWorld/Build/CMakeFiles/CMakeTmp



  Run Build Command:"C:/PROGRA~2/Ninja/ninja.exe" "cmTC_80f4d"

  ninja: error: build.ninja:30: loading 'rules.ninja':
  指定されたファイルが見つかりません。



  include rules.ninja

                     ^ near here





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:10 (project)


-- Configuring incomplete, errors occurred!
See also "C:/gitwork/test/test/cmake-sample/HelloWorld/Build/CMakeFiles/CMakeOutput.log". See also "C:/gitwork/test/test/cmake-sample/HelloWorld/Build/CMakeFiles/CMakeError.log".
-------------------------------------------------------------------

This is the output of cmake 3.7.1 for the same project.
-------------------------------------------------------------------
-- The C compiler identification is MSVC 19.11.25506.0
-- The CXX compiler identification is MSVC 19.11.25506.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/gitwork/test/test/cmake-sample/HelloWorld/Build
-------------------------------------------------------------------


--
Masaru Tsuchiyama <[email protected]>
--

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

Reply via email to