Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
Hi, the code looks right to me. Thanks a lot for fixing that so quickly. Brad is also right about the first byte. The command has the argument already attached. Michael On 06/08/2016 06:46 PM, Brad King wrote: > On 06/08/2016 12:43 PM, Rolf Eike Beer wrote: >>> Run ranlib on archives only if the tool is available >>> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea598671 >> Shouldn't the first check also be "cmd == ":" instead of only >> checking the first byte? > No, because the command in question is actually ": libfoo.a". > No valid command can start in ":" on any platform. > > -Brad > -- 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
Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
On 06/08/2016 12:43 PM, Rolf Eike Beer wrote: >> Run ranlib on archives only if the tool is available >> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea598671 > > Shouldn't the first check also be "cmd == ":" instead of only > checking the first byte? No, because the command in question is actually ": libfoo.a". No valid command can start in ":" on any platform. -Brad -- 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
Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
Am Mittwoch, 8. Juni 2016, 12:24:29 schrieb Brad King: > On 06/08/2016 03:33 AM, "Michael Jäntsch" wrote: > > the : is obviously the default for noop which is correct for > > Linux but not for Windows. My CMakeCache has the following entry: > > //noop for ranlib > > > CMAKE_RANLIB:INTERNAL=: > I see that here: > > > https://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeFindBinUtils.cma > ke;hb=v3.5.2#l55 > > if(NOT CMAKE_RANLIB) > set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") > endif() > > Here is a fix: > > Run ranlib on archives only if the tool is available > https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea598671 Shouldn't the first check also be "cmd == ":" instead of only checking the first byte? Eike signature.asc Description: This is a digitally signed message part. -- 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
Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
On 06/08/2016 03:33 AM, "Michael Jäntsch" wrote: > the : is obviously the default for noop which is correct for > Linux but not for Windows. My CMakeCache has the following entry: > //noop for ranlib > CMAKE_RANLIB:INTERNAL=: I see that here: https://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeFindBinUtils.cmake;hb=v3.5.2#l55 if(NOT CMAKE_RANLIB) set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") endif() Here is a fix: Run ranlib on archives only if the tool is available https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea598671 Thanks, -Brad -- 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
Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
Ah ok. That is interesting. If I set the CMAKE_RANLIB (after my Project command) it gets executed correctly. Interesting is that this is not needed for mingw makefiles. I also do not know how to set the RANLIB properly in my toolchain file. Either way, the : is obviously the default for noop which is correct for Linux but not for Windows. My CMakeCache has the following entry: //noop for ranlib CMAKE_RANLIB:INTERNAL=: Michael Gesendet: Dienstag, 07. Juni 2016 um 15:37 Uhr Von: "Brad King" <brad.k...@kitware.com> An: michael.jaent...@gmx.de Cc: cmake-developers@cmake.org Betreff: Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows On 06/07/2016 02:07 AM, michael.jaent...@gmx.de wrote: > problem is not the POST_BUILD which is set to "cd ." as you said but the > CMAKE_CXX_ARCHIVE_FINISH which is before the POST_BUILD [snip] > command = ... D:\gcc\win32\mips-sde-elf\bin\mips-sde-elf-ar.exe qc $TARGET_FILE $LINK_FLAGS $in && : $TARGET_FILE && $POST_BUILD" That is meant to be the "ranlib" call. The only way I was able to get a ":" there was by setting -DCMAKE_RANLIB=: on the command line. What is its value? See CMakeFiles/${CMAKE_VERSION}/CMakeCCompiler.cmake for a set(CMAKE_RANLIB) call. Does the toolchain provide a "ranlib" tool? -Brad -- 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
Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
On 06/07/2016 02:07 AM, michael.jaent...@gmx.de wrote: > problem is not the POST_BUILD which is set to "cd ." as you said but the > CMAKE_CXX_ARCHIVE_FINISH which is before the POST_BUILD [snip] > command = ... D:\gcc\win32\mips-sde-elf\bin\mips-sde-elf-ar.exe qc > $TARGET_FILE $LINK_FLAGS $in && : $TARGET_FILE && $POST_BUILD" That is meant to be the "ranlib" call. The only way I was able to get a ":" there was by setting -DCMAKE_RANLIB=: on the command line. What is its value? See CMakeFiles/${CMAKE_VERSION}/CMakeCCompiler.cmake for a set(CMAKE_RANLIB) call. Does the toolchain provide a "ranlib" tool? -Brad -- 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
Re: [cmake-developers] Bug in CMake: Generated Ninja files do not work on Windows
On 06/06/2016 10:11 AM, "Michael Jäntsch" wrote: > I would like to report a bug which I found in CMake 3.6.0-rc1. However, > it is also present in release 3.5.2 and probably earlier releases as well. > > Description: > The generated rule in rules.ninja for linking static libraries contains > the command for actual linking and an additional command ": $TARGET_FILE". > This works fine on linux but fails on windows (":" is not a valid command). I'm not able to see the behavior you describe. The Ninja generator is well-tested on Windows. The code that generates a ":" command is here: https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalNinjaGenerator.cxx;hb=v3.6.0-rc1#l291 but is conditioned to generate "cd ." on Windows hosts instead. Where did you get the CMake binary you're running? What toolchain are you using to build? Can you provide a sample CMakeLists.txt file (or source tarball) that shows the problem? Thanks, -Brad -- 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