From ben.boeckel at kitware.com Mon Jan 1 09:42:53 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 1 Jan 2018 09:42:53 -0500 Subject: [cmake-developers] Build failure due to {cd bindir} failed on Windows/Ninja In-Reply-To: References: <20171229150223.GA26168@megas.kitware.com> Message-ID: <20180101144253.GA23312@megas.kitware.com> On Fri, Dec 29, 2017 at 13:32:54 -0800, Jom O'Fisher wrote: > >> Ninja should be using relative paths for the build tree and absolute > for anything outside of it. > That appears to be the case, so I need a better theory. I noticed another > difference between compilation phase and link phase. The link phase is > bracketed by cmd.exe /C "cd . && && cd .". > I'm wondering problem those "cd ." calls are solving? Their presences is > what's causing everything to be wrapped in "cmd /C" They're the "no-op" of the PRE_LINK and POST_LINK commands for targets. > Here's the error that encapsulates the failure > > CMake Error at D:/Android/sdk/cmake/3.6.3155560/share/cmake-3.6/ > Modules/CMakeTestCCompiler.cmake:61 (message): > The C compiler > "D:/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/ > windows-x86_64/bin/clang.exe" > is not able to compile a simple test program. > It fails with the following output: > Change Dir: D:/src/MyApplication/app/.externalNativeBuild/cmake/ > debug/armeabi/CMakeFiles/CMakeTmp > > Run Build Command:"D:\Android\sdk\cmake\3.6.3155560\bin\ninja.exe" > "cmTC_0dcd8" > [1/2] Building C object CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o > [2/2] Linking C executable cmTC_0dcd8 > FAILED: cmd.exe /C "cd . && > D:\Android\sdk\ndk-bundle\toolchains\llvm\prebuilt\ > windows-x86_64\bin\clang.exe > --target=armv5te-none-linux-androideabi > --gcc-toolchain=D:/Android/sdk/ndk-bundle/toolchains/arm- > linux-androideabi-4.9/prebuilt/windows-x86_64 > --sysroot=D:/Android/sdk/ndk-bundle/sysroot -isystem > D:/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi > -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables > -fstack-protector-strong -no-canonical-prefixes -march=armv5te > -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack > -Wformat -Werror=format-security -Wl,--exclude-libs,libgcc.a --sysroot > D:/Android/sdk/ndk-bundle/platforms/android-14/arch-arm -Wl,--build-id > -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined > -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now > -Wl,--gc-sections -Wl,-z,nocopyreloc > CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o -o cmTC_0dcd8 -lm && cd ." > clang.exe: error: no such file or directory: > 'CMakeFiles/cmTC_0dcd8.dir/testCCompiler.c.o' > ninja: build stopped: subcommand failed. You can pass `--debug-trycompile` to keep the output of the try compile step. Running the command manually may help to narrow down the problem. The tools mentioned here may also help: https://stackoverflow.com/questions/3847745/systrace-for-windows --Ben From domen.vrankar at gmail.com Tue Jan 2 17:39:31 2018 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Tue, 2 Jan 2018 23:39:31 +0100 Subject: [cmake-developers] Problem with created debian package In-Reply-To: <1692378.GO9LxbZiVc@amd64> References: <9411017.E9NYm8Fdsl@amd64> <1692378.GO9LxbZiVc@amd64> Message-ID: 2017-12-30 6:29 GMT+01:00 Kornel Benko : > > 2) use gnu tar instead by setting CPACK_DEBIAN_ARCHIVE_TYPE to gnutar > > Thanks, this is really nice. Meanwhile I found out what was going wrong. > The package manager seems to not understand the way some filenames > containing > non-ascii chars are coded by cpack. > I prepared a minimal example showing the effect here. > > 1.) Create a dir and copy the attached to it > 2.) mkdir build; cd bild > 3.) cmake .. -DCPACK_BINARY_DEB:BOOL=ON > 4.) sudo dpkg -i wrongfilename-0.1.1-Linux.deb > (Reading database ... 422665 files and directories currently > installed.) > Preparing to unpack wrongfilename-0.1.1-Linux.deb ... > Unpacking wrongfilename (0.1.1) ... > dpkg: error processing archive wrongfilename-0.1.1-Linux.deb > (--install): > corrupted filesystem tarfile - corrupted package archive > Errors were encountered while processing: > wrongfilename-0.1.1-Linux.deb > Thanks for the example. The "use gnu tar option with CPack" produces a valid package for your example: set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") It would seem that non gnu version doesn't handle non ascii filenames correctly. I'm not certain if it's an libarchive bug or expectedly unsupported feature (it would seem that it's a bug...) - I'll have to investigate further. Thanks, Domen -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at johnwordsworth.com Wed Jan 3 16:27:37 2018 From: john at johnwordsworth.com (John Wordsworth) Date: Wed, 3 Jan 2018 22:27:37 +0100 Subject: [cmake-developers] Optionally disabling static lib dependencies with COMPILE_DEPENDS Message-ID: I have recently been reviewing ways to improve build times for our project, which is comprised of a number of static libraries. I stumbled across this post on the CMake tracker from 2012/13 (https://cmake.org/Bug/view.php?id=13799 ). It suggests adding a COMPILE_DEPENDS target property to to explicitly set dependencies for STATIC libraries instead of always using all linked libraries as build-order dependencies. Having done a draft implementation in a local CMake repository it has shaved off 20% of our 120s build time. I expect the savings to be much more dramatic when I test with Incredibuild (approximately 50% based on tests done previously from just deleting dependencies manually in Visual Studio). I don?t really want to refactor our code to use ?OBJECT? libraries as the inability to link with other targets means that propagating compile options / include directories etc down the chain of linked libs becomes painful. This method allows me to switch between static and shared libs using a config option and none of my CMake scripts need to change. Anyway, I was wondering whether there was any interest in me pushing my solution back to Git / submitting a Pull request so that it might be merged in at some point. If there is - any advice on any gotchas I might watch for instead of just adding some fairly simple code to cmComputeTargetDepends.cxx would be gratefully received - especially as this is my first time poking around in CMake code. // John Wordsworth -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.scott at crascit.com Thu Jan 4 04:48:53 2018 From: craig.scott at crascit.com (Craig Scott) Date: Thu, 4 Jan 2018 20:48:53 +1100 Subject: [cmake-developers] Optionally disabling static lib dependencies with COMPILE_DEPENDS In-Reply-To: References: Message-ID: On Thu, Jan 4, 2018 at 8:27 AM, John Wordsworth wrote: > I have recently been reviewing ways to improve build times for our > project, which is comprised of a number of static libraries. I stumbled > across this post on the CMake tracker from 2012/13 ( > https://cmake.org/Bug/view.php?id=13799). It suggests adding a > COMPILE_DEPENDS target property to to explicitly set dependencies for > STATIC libraries instead of always using all linked libraries as > build-order dependencies. > > Having done a draft implementation in a local CMake repository it has > shaved off 20% of our 120s build time. I expect the savings to be much > more dramatic when I test with Incredibuild (approximately 50% based on > tests done previously from just deleting dependencies manually in Visual > Studio). > > I don?t really want to refactor our code to use ?OBJECT? libraries as the > inability to link with other targets means that propagating compile options > / include directories etc down the chain of linked libs becomes painful. > This method allows me to switch between static and shared libs using a > config option and none of my CMake scripts need to change. > There's a couple more choices here. If your project consists of lots of small (static) libraries, consider whether you can combine some of them to result in a smaller number of larger libraries. This isn't always a gain, but in terms of ability to compile sources in parallel, it will often lead to more efficient builds. You just need to be careful you don't end up with so many objects being combined into one library that you start to hit max open file limits during linking/archiving (something I've hit on multiple platforms lately, so it's not just a hypothetical example). Use of target_sources() can be quite helpful if you want to try out this path (you may find this article helpful). Another choice is to go in the opposite direction and take advantage of the optimisation made for the Ninja generator (if that's a choice open to you) that was introduced in CMake 3.9.0 where if no custom commands exist on a target A, then compilation steps of another target B linking to A are allowed to proceed without waiting for A's link step to complete. Only B's link step will depend on A's link step. In your project, if you have custom commands, see if you can split up that target into just those sources that need the results of the custom command and another target that doesn't. The latter will then be able to compile earlier, so fewer sources have to wait for earlier linking steps. This might be hard to do, it really depends on how your project is structured. Both of the above choices allow you to retain the automatic propagation of compile options, include directories, etc. and to switch between shared/static easily, but the latter is specific to the Ninja generator and may not be an acceptable change for you. > > Anyway, I was wondering whether there was any interest in me pushing my > solution back to Git / submitting a Pull request so that it might be merged > in at some point. If there is - any advice on any gotchas I might watch for > instead of just adding some fairly simple code to > cmComputeTargetDepends.cxx would be gratefully received - especially as > this is my first time poking around in CMake code. > The existing behaviour is conservative and any change would have to also be conservative, meaning that it must not introduce any possibility of breaking existing projects. If I'm understanding your proposed feature correctly, it sounds like you want to relax the build-order dependencies by default when a COMPILE_DEPENDS target property is defined. Basically, if COMPILE_DEPENDS is defined, you are taking over responsibility for the build-order dependencies. This would be something I'd usually discourage projects from doing because such manual dependencies would be a prime candidate for not being kept up to date as a project evolves, leading to subtle, hard-to-trace build errors. Some judicious project restructuring can normally give a pretty efficient parallel build without having to resort to such measures, so I'm wary of adding a feature like this (though I can understand the desire for it). In my experience, you can get some considerable speedups using tools like ccache (and its equivalents for other platforms/compilers). These obviously only help for subsequent builds of things that have been built previously, but for everyday development where you switch between branches or for CI servers doing lots of similar builds, the savings can be impressively big. -- Craig Scott Melbourne, Australia https://crascit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.noulard at gmail.com Thu Jan 4 06:16:43 2018 From: eric.noulard at gmail.com (Eric Noulard) Date: Thu, 4 Jan 2018 12:16:43 +0100 Subject: [cmake-developers] Optionally disabling static lib dependencies with COMPILE_DEPENDS In-Reply-To: References: Message-ID: 2018-01-04 10:48 GMT+01:00 Craig Scott : > > > On Thu, Jan 4, 2018 at 8:27 AM, John Wordsworth > wrote: > >> I have recently been reviewing ways to improve build times for our >> project, which is comprised of a number of static libraries. I stumbled >> across this post on the CMake tracker from 2012/13 ( >> https://cmake.org/Bug/view.php?id=13799). It suggests adding a >> COMPILE_DEPENDS target property to to explicitly set dependencies for >> STATIC libraries instead of always using all linked libraries as >> build-order dependencies. >> >> Having done a draft implementation in a local CMake repository it has >> shaved off 20% of our 120s build time. I expect the savings to be much >> more dramatic when I test with Incredibuild (approximately 50% based on >> tests done previously from just deleting dependencies manually in Visual >> Studio). >> > You said you tested with Incredibuild but with what kind of configuration? AFAIK Incredibuild takes its power from distributing the build? So does your CMake test uses something that distribute the build too ? > >> I don?t really want to refactor our code to use ?OBJECT? libraries as the >> inability to link with other targets means that propagating compile options >> / include directories etc down the chain of linked libs becomes painful. >> This method allows me to switch between static and shared libs using a >> config option and none of my CMake scripts need to change. >> > > There's a couple more choices here. If your project consists of lots of > small (static) libraries, consider whether you can combine some of them to > result in a smaller number of larger libraries. This isn't always a gain, > but in terms of ability to compile sources in parallel, it will often lead > to more efficient builds. You just need to be careful you don't end up with > so many objects being combined into one library that you start to hit max > open file limits during linking/archiving (something I've hit on multiple > platforms lately, so it's not just a hypothetical example). Use of > target_sources() can be quite helpful if you want to try out this path (you > may find this article > > helpful). > > Another choice is to go in the opposite direction and take advantage of > the optimisation made for the Ninja generator (if that's a choice open to > you) that was introduced in CMake 3.9.0 > where if no > custom commands exist on a target A, then compilation steps of another > target B linking to A are allowed to proceed without waiting for A's link > step to complete. Only B's link step will depend on A's link step. In your > project, if you have custom commands, see if you can split up that target > into just those sources that need the results of the custom command and > another target that doesn't. The latter will then be able to compile > earlier, so fewer sources have to wait for earlier linking steps. This > might be hard to do, it really depends on how your project is structured. > I fully agree with Craig here. We use CMake + Ninja and we get really efficient parallel build (on 10+ cores machines). This is on Linux though but it seems MS is putting effort to get CMake + ninja build work with Visual Studio: https://blogs.msdn.microsoft.com/vcblog/2017/05/10/cmake-support-in-visual-studio-whats-new-in-2017-15-3-update/ Another way to improve your build may be to review your dependency graph carefully. You can use cmake --grahviz options to dump the graph and see whether you can cut some dependencies due to transitivity of dependency. I have seen many projects with "overspecified deps". I think this impair build time when using a lot of static libs because in that case you may get poor performance link time. Namelly if you have many unit tests linking to too many static libs because of overspecified deps. That said you did not specify whether if the 120s build time is only for the library or if this is a "global" build time which includes linking somes executables and possible unit tests programs. Note that even if this is not the case having a "big-picture" look at the dependency build graph generated by CMake may be insightful. Note that with CMake 3.10 you can now see difference between PUBLIC, PRIVATE and INTERFACE deps: https://cmake.org/cmake/help/v3.10/release/3.10.html > > Both of the above choices allow you to retain the automatic propagation of > compile options, include directories, etc. and to switch between > shared/static easily, but the latter is specific to the Ninja generator and > may not be an acceptable change for you. > > >> >> Anyway, I was wondering whether there was any interest in me pushing my >> solution back to Git / submitting a Pull request so that it might be merged >> in at some point. If there is - any advice on any gotchas I might watch for >> instead of just adding some fairly simple code to >> cmComputeTargetDepends.cxx would be gratefully received - especially as >> this is my first time poking around in CMake code. >> > > The existing behaviour is conservative and any change would have to also > be conservative, meaning that it must not introduce any possibility of > breaking existing projects. If I'm understanding your proposed feature > correctly, it sounds like you want to relax the build-order dependencies by > default when a COMPILE_DEPENDS target property is defined. Basically, if > COMPILE_DEPENDS is defined, you are taking over responsibility for the > build-order dependencies. This would be something I'd usually discourage > projects from doing because such manual dependencies would be a prime > candidate for not being kept up to date as a project evolves, leading to > subtle, hard-to-trace build errors. Some judicious project restructuring > can normally give a pretty efficient parallel build without having to > resort to such measures, so I'm wary of adding a feature like this (though > I can understand the desire for it). > > In my experience, you can get some considerable speedups using tools like > ccache (and its equivalents for other platforms/compilers). These obviously > only help for subsequent builds of things that have been built previously, > but for everyday development where you switch between branches or for CI > servers doing lots of similar builds, the savings can be impressively big. > +1 again. ccache boost our build. It can be more than 10x faster (depends on cache hit). You can even share (on a local network) the ccache directory between developers and the CI and get very high hit rate (> 80%). Now I'm not working on windows nor with Visual Studio and AFAIK ccache does not work with MSVC. There seem to be alternative, https://github.com/frerich/clcache, but as you guessed I did never used that. -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at johnwordsworth.com Fri Jan 5 04:09:43 2018 From: john at johnwordsworth.com (John Wordsworth) Date: Fri, 5 Jan 2018 10:09:43 +0100 Subject: [cmake-developers] Optionally disabling static lib dependencies with COMPILE_DEPENDS In-Reply-To: References: Message-ID: I realise I wasn't very clear in my previous explanation. Hopefully this paints a better picture; - We have 40 or so developers spread across Visual Studio 2015 (MSBuild - Windows), Xcode (macOS) and Make/Clang (Linux). 80% use Windows. - We have a core set of libs in use by a number of projects (~30 static libs and ~10 different projects), but the projects mix and match which libs they use - merging the static libs (beyond a few of them) isn't something we want to do. - I have recently been revising our CMake structure and have boiled it down to a fairly simple "add_library(x), target_link_libraries(x, default_compile_settings, dependencies)" which means compile settings, include directories and macros propagate through the libs nicely. - We sometimes want to build and use certain libs as shared libs instead of static libs. With regards to the COMPILE_DEPENDS feature that I have mocked up and started testing with our team; - If and only if COMPILE_DEPENDS is set for a STATIC library, then when building the target dependencies for that library, it uses the list of provided targets instead of those that would have been inferred from previous calls to "target_link_libraries" or "add_dependencies". The reality is, the libs which are being built statically can nearly all build in parallel with only one or two "real" dependencies. I understand that our case is rather specific, but having implemented "COMPILE_DEPENDS" and written ~10 lines of CMake in our project (hard coding the one or two actual build order dependencies and disabling the rest), our compile graph looks much nicer and saves a significant amount of time building on a single machine (see https://www.johnwordsworth.com/temp/cmake_compile_ depends.jpg). We see similar savings on macOS using Xcode but have not tested on Linux yet. When we allow Incredibuild to distribute building of compilation units across 15-20 agents, the proportional build time drops more dramatically between the two (the same project goes from ~2.6mins -> ~1.6mins). I understand that just "hard overriding" the target dependencies is a bit messy, but I'd also be happy to explore other ways I could add a similar feature to CMake if there is a potentially better way to do this. What I am ideally looking for in a solution is that I can continue to propagate include directories / compile settings / preprocessor macros through the chain of libs and that it improves building static libs in parallel across all our build systems (MSVC / XCode / make). Ideally, I wouldn't have to restructure my CMake project too much either - as the draft I have for our new structure feels super clean now and refactoring it just to remove build order dependencies would be shame. If there are any alternative ideas for how to implement this, I'd love to discuss. I'm no CMake expert, but maybe if we could use "target_link_libraries" with OBJECT libraries to grab compile settings, or perhaps I could look into a mechanism for not adding build order dependencies on VS2015/Xcode if there is no need too? Thanks again for the feedback and discussion so far. On Thu, Jan 4, 2018 at 12:16 PM, Eric Noulard wrote: > > 2018-01-04 10:48 GMT+01:00 Craig Scott : > >> >> >> On Thu, Jan 4, 2018 at 8:27 AM, John Wordsworth >> wrote: >> >>> I have recently been reviewing ways to improve build times for our >>> project, which is comprised of a number of static libraries. I stumbled >>> across this post on the CMake tracker from 2012/13 ( >>> https://cmake.org/Bug/view.php?id=13799). It suggests adding a >>> COMPILE_DEPENDS target property to to explicitly set dependencies for >>> STATIC libraries instead of always using all linked libraries as >>> build-order dependencies. >>> >>> Having done a draft implementation in a local CMake repository it has >>> shaved off 20% of our 120s build time. I expect the savings to be much >>> more dramatic when I test with Incredibuild (approximately 50% based on >>> tests done previously from just deleting dependencies manually in Visual >>> Studio). >>> >> > You said you tested with Incredibuild but with what kind of configuration? > AFAIK Incredibuild takes its power from distributing the build? So does > your CMake test uses something that distribute the build too ? > > >> >>> I don?t really want to refactor our code to use ?OBJECT? libraries as >>> the inability to link with other targets means that propagating compile >>> options / include directories etc down the chain of linked libs becomes >>> painful. This method allows me to switch between static and shared libs >>> using a config option and none of my CMake scripts need to change. >>> >> >> There's a couple more choices here. If your project consists of lots of >> small (static) libraries, consider whether you can combine some of them to >> result in a smaller number of larger libraries. This isn't always a gain, >> but in terms of ability to compile sources in parallel, it will often lead >> to more efficient builds. You just need to be careful you don't end up with >> so many objects being combined into one library that you start to hit max >> open file limits during linking/archiving (something I've hit on multiple >> platforms lately, so it's not just a hypothetical example). Use of >> target_sources() can be quite helpful if you want to try out this path (you >> may find this article >> >> helpful). >> >> Another choice is to go in the opposite direction and take advantage of >> the optimisation made for the Ninja generator (if that's a choice open to >> you) that was introduced in CMake 3.9.0 >> where if no >> custom commands exist on a target A, then compilation steps of another >> target B linking to A are allowed to proceed without waiting for A's link >> step to complete. Only B's link step will depend on A's link step. In your >> project, if you have custom commands, see if you can split up that target >> into just those sources that need the results of the custom command and >> another target that doesn't. The latter will then be able to compile >> earlier, so fewer sources have to wait for earlier linking steps. This >> might be hard to do, it really depends on how your project is structured. >> > > I fully agree with Craig here. We use CMake + Ninja and we get really > efficient parallel build (on 10+ cores machines). > This is on Linux though but it seems MS is putting effort to get CMake + > ninja build work with Visual Studio: > https://blogs.msdn.microsoft.com/vcblog/2017/05/10/cmake- > support-in-visual-studio-whats-new-in-2017-15-3-update/ > > Another way to improve your build may be to review your dependency graph > carefully. You can use cmake --grahviz options to dump the graph and see > whether you can cut > some dependencies due to transitivity of dependency. I have seen many > projects with "overspecified deps". I think this impair build time when > using a lot of static libs because in that case you may get > poor performance link time. Namelly if you have many unit tests linking to > too many static libs because of overspecified deps. > > That said you did not specify whether if the 120s build time is only for > the library or if this is a "global" build time which includes linking > somes executables and possible unit tests programs. > > Note that even if this is not the case having a "big-picture" look at the > dependency build graph generated by CMake may be insightful. > Note that with CMake 3.10 you can now see difference between PUBLIC, > PRIVATE and INTERFACE deps: > https://cmake.org/cmake/help/v3.10/release/3.10.html > > > >> >> Both of the above choices allow you to retain the automatic propagation >> of compile options, include directories, etc. and to switch between >> shared/static easily, but the latter is specific to the Ninja generator and >> may not be an acceptable change for you. >> >> >>> >>> Anyway, I was wondering whether there was any interest in me pushing my >>> solution back to Git / submitting a Pull request so that it might be merged >>> in at some point. If there is - any advice on any gotchas I might watch for >>> instead of just adding some fairly simple code to >>> cmComputeTargetDepends.cxx would be gratefully received - especially as >>> this is my first time poking around in CMake code. >>> >> >> The existing behaviour is conservative and any change would have to also >> be conservative, meaning that it must not introduce any possibility of >> breaking existing projects. If I'm understanding your proposed feature >> correctly, it sounds like you want to relax the build-order dependencies by >> default when a COMPILE_DEPENDS target property is defined. Basically, if >> COMPILE_DEPENDS is defined, you are taking over responsibility for the >> build-order dependencies. This would be something I'd usually discourage >> projects from doing because such manual dependencies would be a prime >> candidate for not being kept up to date as a project evolves, leading to >> subtle, hard-to-trace build errors. Some judicious project restructuring >> can normally give a pretty efficient parallel build without having to >> resort to such measures, so I'm wary of adding a feature like this (though >> I can understand the desire for it). >> >> In my experience, you can get some considerable speedups using tools like >> ccache (and its equivalents for other platforms/compilers). These obviously >> only help for subsequent builds of things that have been built previously, >> but for everyday development where you switch between branches or for CI >> servers doing lots of similar builds, the savings can be impressively big. >> > > +1 again. > > ccache boost our build. It can be more than 10x faster (depends on cache > hit). > You can even share (on a local network) the ccache directory between > developers and the CI and get very high hit rate (> 80%). > > Now I'm not working on windows nor with Visual Studio and AFAIK ccache > does not work with MSVC. > There seem to be alternative, https://github.com/frerich/clcache, but as > you guessed I did never used that. > > -- > Eric > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seblist at xwmw.org Fri Jan 5 14:34:53 2018 From: seblist at xwmw.org (Sebastian Holtermann) Date: Fri, 05 Jan 2018 20:34:53 +0100 Subject: [cmake-developers] kwsysProcess threadsafety Message-ID: <4776173.KzqDUZkdIB@blauwal> Hello! As you might have noticed I tried to parallelize AUTOMOC/UIC. https://gitlab.kitware.com/cmake/cmake/merge_requests/1632 The issue that's blocking it now is that the kwsysProcess framework isn't thread safe. As a consequence it is not possible for threads to start processes concurrently using the kwsysProcess framework. There are three options I see 1) Make kwsysProcess thread safe I don't think it's impossible but it's not a small task. Looking through the code I found a few issues that would block the whole idea for me. - OpenVMS: I have little to no knowledge about OpenVMS. Wikipedia says it is basically abandoned. Can the OpenVMS code be removed? I couldn't test it anyway. - C vs. C++ There's a lot of C in processUNIX.c (list allocation etc.). I would prefer to use C++11 (or higher), especially std::array, std::vector, std::thread, std::mutex, etc.. Is C++11 acceptable in kwsysProcess? This would make processUNIX.c processUNIX.cpp? 2) Use libuv instead Using the libuv event loop is overkill and would probably imply that more threads are started than necessary (the libuv thread pool will be started anyway). But it would allow to start multiple concurrent (moc/uic) processes. Is there a reason to not use libuv? 3) Abandon the idea to parallelize AUTOMOC/UIC Well, I liked the idea. Any thoughts? -Sebastian From seblist at xwmw.org Fri Jan 5 15:25:17 2018 From: seblist at xwmw.org (Sebastian Holtermann) Date: Fri, 05 Jan 2018 21:25:17 +0100 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <817653610.13054045.1515182430156.JavaMail.zimbra@elemtech.com> References: <4776173.KzqDUZkdIB@blauwal> <817653610.13054045.1515182430156.JavaMail.zimbra@elemtech.com> Message-ID: <1811653.G2k9T0IVT5@blauwal> On Freitag, 5. Januar 2018 13:00:30 CET clinton at elemtech.com wrote: > Cool. I'd like to have parallel automoc and uic. > > How about this 4th option? > Don't use threads. A single thread is able to spawn multiple processes, and > wait on multiple processes, and react when 1 or more processes change > state. I'm probably not familiar enough with kwsysProcess to know if this > approach will work, but it might be easier and simpler(?) than making it > thread safe. > > Clint > AFAIK there are two interfaces inside CMake that allow to start a process, kwsysProcess and libuv. kwsysProcess allows to start a single process and wait for it to finish. I thinks it's also possible to start multiple parallel processes. But there's no interface to select/poll a number of parallel processes. So the 4th option would boil down to use libuv for process management. Sebastian From clinton at elemtech.com Fri Jan 5 15:00:30 2018 From: clinton at elemtech.com (clinton at elemtech.com) Date: Fri, 5 Jan 2018 13:00:30 -0700 (MST) Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <4776173.KzqDUZkdIB@blauwal> References: <4776173.KzqDUZkdIB@blauwal> Message-ID: <817653610.13054045.1515182430156.JavaMail.zimbra@elemtech.com> Cool. I'd like to have parallel automoc and uic. How about this 4th option? Don't use threads. A single thread is able to spawn multiple processes, and wait on multiple processes, and react when 1 or more processes change state. I'm probably not familiar enough with kwsysProcess to know if this approach will work, but it might be easier and simpler(?) than making it thread safe. Clint ----- On Jan 5, 2018, at 12:34 PM, Sebastian Holtermann seblist at xwmw.org wrote: > Hello! > > As you might have noticed I tried to parallelize AUTOMOC/UIC. > https://gitlab.kitware.com/cmake/cmake/merge_requests/1632 > The issue that's blocking it now is that the kwsysProcess framework > isn't thread safe. As a consequence it is not possible for threads to > start processes concurrently using the kwsysProcess framework. > > There are three options I see > > 1) Make kwsysProcess thread safe > > I don't think it's impossible but it's not a small task. > Looking through the code I found a few issues that > would block the whole idea for me. > - OpenVMS: I have little to no knowledge about OpenVMS. > Wikipedia says it is basically abandoned. > Can the OpenVMS code be removed? I couldn't test it anyway. > > - C vs. C++ > There's a lot of C in processUNIX.c (list allocation etc.). > I would prefer to use C++11 (or higher), especially > std::array, std::vector, std::thread, std::mutex, etc.. > Is C++11 acceptable in kwsysProcess? > This would make processUNIX.c processUNIX.cpp? > > 2) Use libuv instead > > Using the libuv event loop is overkill and would probably imply that > more threads are started than necessary > (the libuv thread pool will be started anyway). > But it would allow to start multiple concurrent (moc/uic) processes. > Is there a reason to not use libuv? > > 3) Abandon the idea to parallelize AUTOMOC/UIC > > Well, I liked the idea. > > > Any thoughts? > > -Sebastian > > -- > > 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: > https://cmake.org/mailman/listinfo/cmake-developers From ben.boeckel at kitware.com Fri Jan 5 16:47:25 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 5 Jan 2018 16:47:25 -0500 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <4776173.KzqDUZkdIB@blauwal> References: <4776173.KzqDUZkdIB@blauwal> Message-ID: <20180105214725.GA17149@megas.kitware.com> On Fri, Jan 05, 2018 at 20:34:53 +0100, Sebastian Holtermann wrote: > 2) Use libuv instead libuv for process management is on the list. I think it is waiting for porting to all of CMake's platforms to actually happen. I'm seeing this PR hung up on process: https://github.com/libuv/libuv/pull/1527 I don't know how much followup work there is. I thought there was a CMake issue tracking it, but I don't see one. --Ben From seblist at xwmw.org Sat Jan 6 02:31:26 2018 From: seblist at xwmw.org (Sebastian Holtermann) Date: Sat, 06 Jan 2018 08:31:26 +0100 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <20180105214725.GA17149@megas.kitware.com> References: <4776173.KzqDUZkdIB@blauwal> <20180105214725.GA17149@megas.kitware.com> Message-ID: <8020824.cVAZQE1hnl@blauwal> > > 2) Use libuv instead I just saw the libuv library in the CMake sources. > libuv for process management is on the list. I think it is waiting for > porting to all of CMake's platforms to actually happen. Does that mean it's only there for some specific scenarios and shouldn't be used in general? > I'm seeing this PR hung up on process: > > https://github.com/libuv/libuv/pull/1527 > > I don't know how much followup work there is. I thought there was a > CMake issue tracking it, but I don't see one. IIUC this is about the CPU affinity for child processes? Looks nice, but in AUTOMOC/UIC it's sufficient to just known which child processes are running and to get a notification when one has finished. I think that this level of control is available in libuv already. Sebastian From jeanmichael.celerier at gmail.com Mon Jan 8 04:32:22 2018 From: jeanmichael.celerier at gmail.com (=?UTF-8?Q?Jean=2DMicha=C3=ABl_Celerier?=) Date: Mon, 8 Jan 2018 10:32:22 +0100 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <4776173.KzqDUZkdIB@blauwal> References: <4776173.KzqDUZkdIB@blauwal> Message-ID: > 3) Abandon the idea to parallelize AUTOMOC/UIC please no ! moc is a huge bottleneck in my builds (to the point that using verdigris instead ends up having faster build time overall). Best, Jean-Micha?l ------- Jean-Micha?l Celerier http://www.jcelerier.name On Fri, Jan 5, 2018 at 8:34 PM, Sebastian Holtermann wrote: > Hello! > > As you might have noticed I tried to parallelize AUTOMOC/UIC. > https://gitlab.kitware.com/cmake/cmake/merge_requests/1632 > The issue that's blocking it now is that the kwsysProcess framework > isn't thread safe. As a consequence it is not possible for threads to > start processes concurrently using the kwsysProcess framework. > > There are three options I see > > 1) Make kwsysProcess thread safe > > I don't think it's impossible but it's not a small task. > Looking through the code I found a few issues that > would block the whole idea for me. > - OpenVMS: I have little to no knowledge about OpenVMS. > Wikipedia says it is basically abandoned. > Can the OpenVMS code be removed? I couldn't test it anyway. > > - C vs. C++ > There's a lot of C in processUNIX.c (list allocation etc.). > I would prefer to use C++11 (or higher), especially > std::array, std::vector, std::thread, std::mutex, etc.. > Is C++11 acceptable in kwsysProcess? > This would make processUNIX.c processUNIX.cpp? > > 2) Use libuv instead > > Using the libuv event loop is overkill and would probably imply that > more threads are started than necessary > (the libuv thread pool will be started anyway). > But it would allow to start multiple concurrent (moc/uic) processes. > Is there a reason to not use libuv? > > 3) Abandon the idea to parallelize AUTOMOC/UIC > > Well, I liked the idea. > > > Any thoughts? > > -Sebastian > > -- > > 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: > https://cmake.org/mailman/listinfo/cmake-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Mon Jan 8 06:56:57 2018 From: brad.king at kitware.com (Brad King) Date: Mon, 8 Jan 2018 06:56:57 -0500 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <8020824.cVAZQE1hnl@blauwal> References: <4776173.KzqDUZkdIB@blauwal> <20180105214725.GA17149@megas.kitware.com> <8020824.cVAZQE1hnl@blauwal> Message-ID: On 01/06/2018 02:31 AM, Sebastian Holtermann wrote: >>> 2) Use libuv instead > > I just saw the libuv library in the CMake sources. > >> libuv for process management is on the list. I think it is waiting for >> porting to all of CMake's platforms to actually happen. > > Does that mean it's only there for some specific scenarios and shouldn't > be used in general? A goal is to eventually fully replace use of KWSys Process with libuv. I'd prefer not to make any major changes to KWSys Process in the meantime. Currently libuv is used only for the server mode, but soon it will be used for CTest too: https://gitlab.kitware.com/cmake/cmake/merge_requests/1455 > Looks nice, but in AUTOMOC/UIC it's sufficient to just known which child > processes are running and to get a notification when one has finished. Use of libuv's process management for that would be good. It supports fully asynchronous operation and so can manage many child processes from one thread. Thanks, -Brad From seblist at xwmw.org Mon Jan 8 07:26:53 2018 From: seblist at xwmw.org (Sebastian Holtermann) Date: Mon, 08 Jan 2018 13:26:53 +0100 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: References: <4776173.KzqDUZkdIB@blauwal> <8020824.cVAZQE1hnl@blauwal> Message-ID: <4461098.1BX4KFueEi@blauwal> On Montag, 8. Januar 2018 06:56:57 CET Brad King wrote: > On 01/06/2018 02:31 AM, Sebastian Holtermann wrote: > >>> 2) Use libuv instead > > > > I just saw the libuv library in the CMake sources. > > > >> libuv for process management is on the list. I think it is waiting for > >> porting to all of CMake's platforms to actually happen. > > > > Does that mean it's only there for some specific scenarios and shouldn't > > be used in general? > > A goal is to eventually fully replace use of KWSys Process with libuv. > I'd prefer not to make any major changes to KWSys Process in the meantime. > > Currently libuv is used only for the server mode, but soon it will be > used for CTest too: > > https://gitlab.kitware.com/cmake/cmake/merge_requests/1455 > > > Looks nice, but in AUTOMOC/UIC it's sufficient to just known which child > > processes are running and to get a notification when one has finished. > > Use of libuv's process management for that would be good. It supports > fully asynchronous operation and so can manage many child processes from > one thread. Okay. Then I'm going to refactor cmQtAutoGeneratorMocUic to use a libuv event loop internally. -Sebastian From brad.king at kitware.com Mon Jan 8 07:33:12 2018 From: brad.king at kitware.com (Brad King) Date: Mon, 8 Jan 2018 07:33:12 -0500 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: <4461098.1BX4KFueEi@blauwal> References: <4776173.KzqDUZkdIB@blauwal> <8020824.cVAZQE1hnl@blauwal> <4461098.1BX4KFueEi@blauwal> Message-ID: <235154e2-93a7-969a-2b67-8004a9d8e0f8@kitware.com> On 01/08/2018 07:26 AM, Sebastian Holtermann wrote: > Then I'm going to refactor cmQtAutoGeneratorMocUic > to use a libuv event loop internally. Great. Take a look at Source/cmUVHandlePtr.h for some C++ helpers. -Brad From neundorf at kde.org Mon Jan 8 14:50:06 2018 From: neundorf at kde.org (Alexander Neundorf) Date: Mon, 08 Jan 2018 20:50:06 +0100 Subject: [cmake-developers] kwsysProcess threadsafety In-Reply-To: References: <4776173.KzqDUZkdIB@blauwal> Message-ID: <7358593.hyGOZflnW6@linux-l7nd> On 2018 M01 8, Mon 10:32:22 CET Jean-Micha?l Celerier wrote: > > 3) Abandon the idea to parallelize AUTOMOC/UIC > > please no ! moc is a huge bottleneck in my builds (to the point that using > verdigris instead ends up having > faster build time overall). you could also just not use automoc and use the "manual" moc-wrapper macros. This should make the build-time overhead go away. Instead the developer has to add the header file to be moc'ed to the CMakeLists.txt (personally I consider this acceptable). Alex From craig.scott at crascit.com Tue Jan 9 05:30:05 2018 From: craig.scott at crascit.com (Craig Scott) Date: Tue, 9 Jan 2018 21:30:05 +1100 Subject: [cmake-developers] Optionally disabling static lib dependencies with COMPILE_DEPENDS In-Reply-To: References: Message-ID: Perhaps keep an eye on the work going on in merge request 1524 , which may allow you to use object libraries in target_link_libraries(). Not sure if it would cut the dependencies in the way you are seeking, but maybe take a look and see. On Fri, Jan 5, 2018 at 8:08 PM, John Wordsworth wrote: > First of all - thanks for the suggestions. I intend to look into ccache > for our Linux builds in the future and there are some useful tips here for > me to look into. I wasn't aware of clcache and it looks very interesting, > especially combined with network sharing. > > I realise I wasn't very clear in my previous explanation. Hopefully this > paints a better picture; > > - We have 40 or so developers spread across Visual Studio 2015 (MSBuild - > Windows), Xcode (macOS) and Make/Clang (Linux). 80% use Windows. > - We have a core set of libs in use by a number of projects (~30 static > libs and ~10 different projects), but the projects mix and match which libs > they use - merging the static libs (beyond a few of them) isn't something > we want to do. > - I have recently been revising our CMake structure and have boiled it > down to a fairly simple "add_library(x), target_link_libraries(x, > default_compile_settings, dependencies)" which means compile settings, > include directories and macros propagate through the libs nicely. > - We sometimes want to build and use certain libs as shared libs instead > of static libs. > > With regards to the COMPILE_DEPENDS feature that I have mocked up and > started testing with our team; > > - If and only if COMPILE_DEPENDS is set for a STATIC library, then when > building the target dependencies for that library, it uses the list of > provided targets instead of those that would have been inferred from > previous calls to "target_link_libraries" or "add_dependencies". > > The reality is, the libs which are being built statically can nearly all > build in parallel with only one or two "real" dependencies. I understand > that our case is rather specific, but having implemented "COMPILE_DEPENDS" > and written ~10 lines of CMake in our project (hard coding the one or two > actual build order dependencies and disabling the rest), our compile graph > looks much nicer and saves a significant amount of time building on a > single machine (see https://www.johnwordsworth.com/temp/cmake_compile_ > depends.jpg). We see similar savings on macOS using Xcode but have not > tested on Linux yet. When we allow Incredibuild to distribute building of > compilation units across 15-20 agents, the proportional build time drops > more dramatically between the two (the same project goes from ~2.6mins -> > ~1.6mins). > > I understand that just "hard overriding" the target dependencies is a bit > messy, but I'd also be happy to explore other ways I could add a similar > feature to CMake if there is a potentially better way to do this. What I am > ideally looking for in a solution is that I can continue to propagate > include directories / compile settings / preprocessor macros through the > chain of libs and that it improves building static libs in parallel across > all our build systems (MSVC / XCode / make). Ideally, I wouldn't have to > restructure my CMake project too much either - as the draft I have for our > new structure feels super clean now and refactoring it just to remove build > order dependencies would be shame. If there are any alternative ideas for > how to implement this, I'd love to discuss. I'm no CMake expert, but maybe > if we could use "target_link_libraries" with OBJECT libraries to grab > compile settings, or perhaps I could look into a mechanism for not adding > build order dependencies on VS2015/Xcode if there is no need too? > > Thanks again for the feedback and discussion so far. > > // John W > > On Thu, Jan 4, 2018 at 12:16 PM, Eric Noulard > wrote: > >> >> 2018-01-04 10:48 GMT+01:00 Craig Scott : >> >>> >>> >>> On Thu, Jan 4, 2018 at 8:27 AM, John Wordsworth >> > wrote: >>> >>>> I have recently been reviewing ways to improve build times for our >>>> project, which is comprised of a number of static libraries. I stumbled >>>> across this post on the CMake tracker from 2012/13 ( >>>> https://cmake.org/Bug/view.php?id=13799). It suggests adding a >>>> COMPILE_DEPENDS target property to to explicitly set dependencies for >>>> STATIC libraries instead of always using all linked libraries as >>>> build-order dependencies. >>>> >>>> Having done a draft implementation in a local CMake repository it has >>>> shaved off 20% of our 120s build time. I expect the savings to be much >>>> more dramatic when I test with Incredibuild (approximately 50% based on >>>> tests done previously from just deleting dependencies manually in Visual >>>> Studio). >>>> >>> >> You said you tested with Incredibuild but with what kind of configuration? >> AFAIK Incredibuild takes its power from distributing the build? So does >> your CMake test uses something that distribute the build too ? >> >> >>> >>>> I don?t really want to refactor our code to use ?OBJECT? libraries as >>>> the inability to link with other targets means that propagating compile >>>> options / include directories etc down the chain of linked libs becomes >>>> painful. This method allows me to switch between static and shared libs >>>> using a config option and none of my CMake scripts need to change. >>>> >>> >>> There's a couple more choices here. If your project consists of lots of >>> small (static) libraries, consider whether you can combine some of them to >>> result in a smaller number of larger libraries. This isn't always a gain, >>> but in terms of ability to compile sources in parallel, it will often lead >>> to more efficient builds. You just need to be careful you don't end up with >>> so many objects being combined into one library that you start to hit max >>> open file limits during linking/archiving (something I've hit on multiple >>> platforms lately, so it's not just a hypothetical example). Use of >>> target_sources() can be quite helpful if you want to try out this path (you >>> may find this article >>> >>> helpful). >>> >>> Another choice is to go in the opposite direction and take advantage of >>> the optimisation made for the Ninja generator (if that's a choice open to >>> you) that was introduced in CMake 3.9.0 >>> where if no >>> custom commands exist on a target A, then compilation steps of another >>> target B linking to A are allowed to proceed without waiting for A's link >>> step to complete. Only B's link step will depend on A's link step. In your >>> project, if you have custom commands, see if you can split up that target >>> into just those sources that need the results of the custom command and >>> another target that doesn't. The latter will then be able to compile >>> earlier, so fewer sources have to wait for earlier linking steps. This >>> might be hard to do, it really depends on how your project is structured. >>> >> >> I fully agree with Craig here. We use CMake + Ninja and we get really >> efficient parallel build (on 10+ cores machines). >> This is on Linux though but it seems MS is putting effort to get CMake + >> ninja build work with Visual Studio: >> https://blogs.msdn.microsoft.com/vcblog/2017/05/10/cmake-sup >> port-in-visual-studio-whats-new-in-2017-15-3-update/ >> >> Another way to improve your build may be to review your dependency graph >> carefully. You can use cmake --grahviz options to dump the graph and see >> whether you can cut >> some dependencies due to transitivity of dependency. I have seen many >> projects with "overspecified deps". I think this impair build time when >> using a lot of static libs because in that case you may get >> poor performance link time. Namelly if you have many unit tests linking >> to too many static libs because of overspecified deps. >> >> That said you did not specify whether if the 120s build time is only for >> the library or if this is a "global" build time which includes linking >> somes executables and possible unit tests programs. >> >> Note that even if this is not the case having a "big-picture" look at the >> dependency build graph generated by CMake may be insightful. >> Note that with CMake 3.10 you can now see difference between PUBLIC, >> PRIVATE and INTERFACE deps: >> https://cmake.org/cmake/help/v3.10/release/3.10.html >> >> >> >>> >>> Both of the above choices allow you to retain the automatic propagation >>> of compile options, include directories, etc. and to switch between >>> shared/static easily, but the latter is specific to the Ninja generator and >>> may not be an acceptable change for you. >>> >>> >>>> >>>> Anyway, I was wondering whether there was any interest in me pushing my >>>> solution back to Git / submitting a Pull request so that it might be merged >>>> in at some point. If there is - any advice on any gotchas I might watch for >>>> instead of just adding some fairly simple code to >>>> cmComputeTargetDepends.cxx would be gratefully received - especially as >>>> this is my first time poking around in CMake code. >>>> >>> >>> The existing behaviour is conservative and any change would have to also >>> be conservative, meaning that it must not introduce any possibility of >>> breaking existing projects. If I'm understanding your proposed feature >>> correctly, it sounds like you want to relax the build-order dependencies by >>> default when a COMPILE_DEPENDS target property is defined. Basically, if >>> COMPILE_DEPENDS is defined, you are taking over responsibility for the >>> build-order dependencies. This would be something I'd usually discourage >>> projects from doing because such manual dependencies would be a prime >>> candidate for not being kept up to date as a project evolves, leading to >>> subtle, hard-to-trace build errors. Some judicious project restructuring >>> can normally give a pretty efficient parallel build without having to >>> resort to such measures, so I'm wary of adding a feature like this (though >>> I can understand the desire for it). >>> >>> In my experience, you can get some considerable speedups using tools >>> like ccache (and its equivalents for other platforms/compilers). These >>> obviously only help for subsequent builds of things that have been built >>> previously, but for everyday development where you switch between branches >>> or for CI servers doing lots of similar builds, the savings can be >>> impressively big. >>> >> >> +1 again. >> >> ccache boost our build. It can be more than 10x faster (depends on cache >> hit). >> You can even share (on a local network) the ccache directory between >> developers and the CI and get very high hit rate (> 80%). >> >> Now I'm not working on windows nor with Visual Studio and AFAIK ccache >> does not work with MSVC. >> There seem to be alternative, https://github.com/frerich/clcache, but as >> you guessed I did never used that. >> >> -- >> Eric >> > > -- Craig Scott Melbourne, Australia https://crascit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From gjasny at googlemail.com Tue Jan 16 05:19:01 2018 From: gjasny at googlemail.com (Gregor Jasny) Date: Tue, 16 Jan 2018 11:19:01 +0100 Subject: [cmake-developers] iOS friendly CMake Message-ID: <9e9d5a26-03bf-2bf7-11a1-4a960b083e38@googlemail.com> Hi, I created a CMake branch where I attempt to provide an easy way to configure CMake projects for iOS (and all other Xcode SDKs). All you need to build for iOS is: cmake -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_SYSROOT=iphoneos -GXcode . In case you build code that must be code signed also add your development team: -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ABCDEFG The merge request is here: https://gitlab.kitware.com/cmake/cmake/merge_requests/1664 Please give it a try and add any comments you have to the merge requests. I only tested it with Xcode 9 on High Sierra so far. Thanks, Gregor From eric.noulard at gmail.com Tue Jan 16 07:10:07 2018 From: eric.noulard at gmail.com (Eric Noulard) Date: Tue, 16 Jan 2018 13:10:07 +0100 Subject: [cmake-developers] Undocumented command line flags (-H, -B) why? Message-ID: Hi there, I came accross -H and -B undocumented command line flags for cmake: https://stackoverflow.com/questions/24460486/cmake-build-type-not-being-used-in-cmakelists-txt/24470998#24470998 Is there any reason to keep those undocumented? -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From cristian.adam at gmail.com Tue Jan 16 08:42:32 2018 From: cristian.adam at gmail.com (Cristian Adam) Date: Tue, 16 Jan 2018 14:42:32 +0100 Subject: [cmake-developers] Undocumented command line flags (-H, -B) why? In-Reply-To: References: Message-ID: There was an attempt to document them: https://www.mail-archive.com/cmake-developers at cmake.org/msg16693.html I don't know why it wasn't a pull request on gitlab though. Cheers, Cristian. On Tue, Jan 16, 2018 at 1:10 PM, Eric Noulard wrote: > Hi there, > > I came accross -H and -B undocumented command line flags for cmake: > https://stackoverflow.com/questions/24460486/cmake- > build-type-not-being-used-in-cmakelists-txt/24470998#24470998 > > Is there any reason to keep those undocumented? > > -- > Eric > > -- > > 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: > https://cmake.org/mailman/listinfo/cmake-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.boeckel at kitware.com Tue Jan 16 08:46:21 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Tue, 16 Jan 2018 08:46:21 -0500 Subject: [cmake-developers] Undocumented command line flags (-H, -B) why? In-Reply-To: References: Message-ID: <20180116134621.GB10587@megas.kitware.com> On Tue, Jan 16, 2018 at 13:10:07 +0100, Eric Noulard wrote: > I came accross -H and -B undocumented command line flags for cmake: > https://stackoverflow.com/questions/24460486/cmake-build-type-not-being-used-in-cmakelists-txt/24470998#24470998 > > Is there any reason to keep those undocumented? They're internal and not meant for use outside of CMake itself. There have been threads on this before. Here's one with a patch to document it that was rejected as-is: https://www.mail-archive.com/cmake-developers at cmake.org/msg16693.html For those who want to submit a patch, there's a TODO list here: https://www.mail-archive.com/cmake-developers at cmake.org/msg16720.html --Ben From eric.noulard at gmail.com Tue Jan 16 09:14:37 2018 From: eric.noulard at gmail.com (Eric Noulard) Date: Tue, 16 Jan 2018 15:14:37 +0100 Subject: [cmake-developers] Undocumented command line flags (-H, -B) why? In-Reply-To: <20180116134621.GB10587@megas.kitware.com> References: <20180116134621.GB10587@megas.kitware.com> Message-ID: Thank you very much for the explanation. 2018-01-16 14:46 GMT+01:00 Ben Boeckel : > On Tue, Jan 16, 2018 at 13:10:07 +0100, Eric Noulard wrote: > > I came accross -H and -B undocumented command line flags for cmake: > > https://stackoverflow.com/questions/24460486/cmake- > build-type-not-being-used-in-cmakelists-txt/24470998#24470998 > > > > Is there any reason to keep those undocumented? > > They're internal and not meant for use outside of CMake itself. There > have been threads on this before. Here's one with a patch to document it > that was rejected as-is: > > https://www.mail-archive.com/cmake-developers at cmake.org/msg16693.html > > For those who want to submit a patch, there's a TODO list here: > > https://www.mail-archive.com/cmake-developers at cmake.org/msg16720.html > > --Ben > -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.boeckel at kitware.com Tue Jan 16 09:36:04 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Tue, 16 Jan 2018 09:36:04 -0500 Subject: [cmake-developers] Undocumented command line flags (-H, -B) why? In-Reply-To: References: Message-ID: <20180116143604.GA937@megas.kitware.com> On Tue, Jan 16, 2018 at 14:42:32 +0100, Cristian Adam wrote: > I don't know why it wasn't a pull request on gitlab though. > Thu, 30 Jun 2016 12:24:02 -0700 This predates Gitlab usage for patch submission (which started around July 2016). --Ben From Lenindarbi.Jayakumar at magna.com Wed Jan 17 03:52:54 2018 From: Lenindarbi.Jayakumar at magna.com (Jayakumar, Lenindarbi) Date: Wed, 17 Jan 2018 08:52:54 +0000 Subject: [cmake-developers] CMAKE :: mingw make files with response file for includes Message-ID: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> Hello, I have encountered a problem with response file usage for includes. My project is using tasking compiler. Issue: Response file link flag "CMAKE_C_RESPONSE_FILE_LINK_FLAG" is not customizable for include paths. Cmake generated the *.rsp file always using @ but this is not accepted by tasking compiler. Tasking compiler expects -f instead of @. ... C_INCLUDES = @CMakeFiles/dummyTarget/includes_C.rsp This issue is only with includes response file. For objects, CMAKE_C_RESPONSE_FILE_LINK_FLAG works. Project setup: set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f ") set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1) Possible cause: The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" function in file https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmMakefileTargetGenerator.cxx. if (useResponseFile) { std::string name = "includes_"; name += lang; name += ".rsp"; std::string arg = "@" + this->CreateResponseFile(name.c_str(), includeFlags, this->FlagFileDepends[lang]); this->LocalGenerator->AppendFlags(flags, arg); } However, the implementation should be like in "cmMakefileTargetGenerator::CreateObjectLists" function. // Lookup the response file reference flag. std::string responseFlagVar = "CMAKE_"; responseFlagVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName); responseFlagVar += "_RESPONSE_FILE_LINK_FLAG"; const char* responseFlag = this->Makefile->GetDefinition(responseFlagVar); if (!responseFlag) { responseFlag = "@"; } Regards, Lenindarbi Jayakumar Software Engineer Magna Electronics Europe GmbH & Co. OHG Kurf?rst-Eppstein-Ring 9 63877 Sailauf OFFICE +49 6093 9942 6462 FAX +49 6093 9942 6001 MOBILE Lenindarbi.Jayakumar at magna.com http://www.magna.com Magna Electronics Europe GmbH & Co. OHG Gesch?ftsf?hrende Gesellschaft: Magna Electronics Europe Verwaltungs GmbH Gesch?ftsf?hrer: Rainer Bruns, Cornelius Wolber Sitz der gesch?ftsf?hrenden Gesellschaft: Sailauf, Deutschland Registergericht: Aschaffenburg / HRB 8778 Sitz der Gesellschaft (OHG): 63877 Sailauf, Deutschland Registergericht: Aschaffenburg / HRA 4616 Diese Nachricht ist ausschlie?lich f?r den oben bezeichneten Adressaten bestimmt und enth?lt m?glicherweise vertrauliche Informationen. Sollten Sie nicht der oben bezeichnete Adressat sein oder diese Nachricht irrt?mlich erhalten haben, ersuchen wir Sie, diese Nachricht nicht weiterzugeben, zu kopieren oder im Vertrauen darauf zu handeln, sondern uns unter Lenindarbi.Jayakumar at magna.com zu verst?ndigen und diese Nachricht samt allf?lliger Anlagen sofort zu l?schen. Vielen Dank. This message is intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee, you should not disseminate, copy, or take any action in reliance on it. If you have received this message in error, please immediately notify Lenindarbi.Jayakumar at magna.com and delete this message and any attachment. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From claus.klein at arcormail.de Wed Jan 17 16:14:32 2018 From: claus.klein at arcormail.de (Claus Klein) Date: Wed, 17 Jan 2018 22:14:32 +0100 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator Message-ID: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> Hi all, there was mail with this issues a view years ago: https://cmake.org/pipermail/cmake/2014-October/058963.html quote: ????????????????????????????????????????????- Ninja generator sets the name to objectpath.d cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d"); WindRiver sets the dep file name to objectDir/SourceName.d, so the ".obj" in "DEP_FILE = path/BaseName.c.obj.d" must be removed Armcc just uses base name in the same directory as the command runs, "BaseName.d". -depend_dir= can be used to control the directory for C but not asm. The workaround is to patch the generated build.ninja A proper solution is using new variables similar to above. (Just examples, not figured out etc) WindRiver (not added to CMake): SET (CMAKE___DEPFILE_PATTERN /.d ) Armcc (RVDS patch exists for CMake): SET (CMAKE_DEPFILE_FLAGS_C -depend_dir= --depend_format=unix) SET (CMAKE_C_ARMCC_DEPFILE_PATTERN /.d ) SET (CMAKE_DEPFILE_FLAGS_ASM --depend_format=unix) SET (CMAKE_ASM_ARMCC_DEPFILE_PATTERN .d ) Note: is replaced in CMAKE_C_ARMCC_DEPFILE_PATTERN (but adding a semicolon), but not (as that is evaluated after FLAGS/DEFINES) so it is a little more than just add new variables. The workaround for armcc could therefore not use CMAKE_DEPFILE_FLAGS_C, the -depend_dir flag was added to normal FLAGS ???????????????????????????????- I have a same problem with a GHS compiler. We can?t control the name of the generated *.d file while compile step. My questions are: 1.) Is ist possible to change the object or/and the dependency file name generated for ninja? 2.) Why generates cmake the objectname as sourcefilename.{c,cpp}.obj? I would expect as in make something like that: DEP:=$(SRC:.cpp=.d) OBJ:=$(SRC:.cpp=.obj) Claus Klein -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Thu Jan 18 12:15:17 2018 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 18 Jan 2018 12:15:17 -0500 Subject: [cmake-developers] [ANNOUNCE] CMake 3.10.2 available for download Message-ID: We are pleased to announce that CMake 3.10.2 is now available for download. Please use the latest release from our download page: https://cmake.org/download/ Thanks for your support! ------------------------------------------------------------------------- Changes in 3.10.2 since 3.10.1: Brad King (2): KWIML: Backport RISC-V update to CMake 3.10 CMake 3.10.2 Egor Pugin (1): FindPostgreSQL: Add support for PG10 Joel T. Frederico (1): cmGraphVizWriter: Updated to create and follow dependers for interface targets Sebastian Holtermann (2): Autogen: Fix for problematic nested list separator Autogen: Ignore not existing source files in cmMakefile From claus.klein at arcormail.de Thu Jan 18 15:55:16 2018 From: claus.klein at arcormail.de (Claus Klein) Date: Thu, 18 Jan 2018 21:55:16 +0100 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator Message-ID: Hi all, there was a mail with this issues a view years ago, but without a result: https://cmake.org/pipermail/cmake/2014-October/058963.html quote: ????????????????????????????????????????????- Ninja generator sets the name to objectpath.d cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d"); WindRiver sets the dep file name to objectDir/SourceName.d, so the ".obj" in "DEP_FILE = path/BaseName.c.obj.d" must be removed Armcc just uses base name in the same directory as the command runs, "BaseName.d". -depend_dir= can be used to control the directory for C but not asm. The workaround is to patch the generated build.ninja A proper solution is using new variables similar to above. (Just examples, not figured out etc) WindRiver (not added to CMake): SET (CMAKE___DEPFILE_PATTERN /.d ) Armcc (RVDS patch exists for CMake): SET (CMAKE_DEPFILE_FLAGS_C -depend_dir= --depend_format=unix) SET (CMAKE_C_ARMCC_DEPFILE_PATTERN /.d ) SET (CMAKE_DEPFILE_FLAGS_ASM --depend_format=unix) SET (CMAKE_ASM_ARMCC_DEPFILE_PATTERN .d ) Note: is replaced in CMAKE_C_ARMCC_DEPFILE_PATTERN (but adding a semicolon), but not (as that is evaluated after FLAGS/DEFINES) so it is a little more than just add new variables. The workaround for armcc could therefore not use CMAKE_DEPFILE_FLAGS_C, the -depend_dir flag was added to normal FLAGS ???????????????????????????????- I have the same problem with a GHS compiler. We can?t control the name of the generated *.d file while compile step. My questions are: 1.) Is ist possible to change the object or/and the dependency file name generated for ninja? 2.) Why generates cmake the objectname as sourcefilename.{c,cpp}.obj? I would expect to build the name as GNU make do, something like that: DEP:=$(SRC:.cpp=.d) OBJ:=$(SRC:.cpp=.obj) Claus Klein -------------- next part -------------- An HTML attachment was scrubbed... URL: From claus.klein at arcormail.de Thu Jan 18 16:14:19 2018 From: claus.klein at arcormail.de (Claus Klein) Date: Thu, 18 Jan 2018 22:14:19 +0100 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator Message-ID: <176C7CDC-BFE1-4A21-81F7-17148E6A5A58@arcormail.de> Hi all, I have problems to send and see this mail at the list? Please can you check what goes wrong? There was a mail with this issue a view years ago, but without a real result: https://cmake.org/pipermail/cmake/2014-October/058963.html quote: ????????????????????????????????????????????- Ninja generator sets the name to objectpath.d cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d"); WindRiver sets the dep file name to objectDir/SourceName.d, so the ".obj" in "DEP_FILE = path/BaseName.c.obj.d" must be removed Armcc just uses base name in the same directory as the command runs, "BaseName.d". -depend_dir= can be used to control the directory for C but not asm. The workaround is to patch the generated build.ninja A proper solution is using new variables similar to above. (Just examples, not figured out etc) WindRiver (not added to CMake): SET (CMAKE___DEPFILE_PATTERN /.d ) Armcc (RVDS patch exists for CMake): SET (CMAKE_DEPFILE_FLAGS_C -depend_dir= --depend_format=unix) SET (CMAKE_C_ARMCC_DEPFILE_PATTERN /.d ) SET (CMAKE_DEPFILE_FLAGS_ASM --depend_format=unix) SET (CMAKE_ASM_ARMCC_DEPFILE_PATTERN .d ) Note: is replaced in CMAKE_C_ARMCC_DEPFILE_PATTERN (but adding a semicolon), but not (as that is evaluated after FLAGS/DEFINES) so it is a little more than just add new variables. The workaround for armcc could therefore not use CMAKE_DEPFILE_FLAGS_C, the -depend_dir flag was added to normal FLAGS ???????????????????????????????- I have the same problem with a GHS compiler. We can?t control the name of the generated *.d file while compile step. My questions are: 1.) Is ist possible to change the object or/and the dependency file name generated for ninja? 2.) Why generates cmake the objectname as sourcefilename.{c,cpp}.obj? I would expect to build the name as GNU make do, something like that: DEP:=$(SRC:.cpp=.d) OBJ:=$(SRC:.cpp=.obj) Claus Klein -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.scott at crascit.com Fri Jan 19 07:30:56 2018 From: craig.scott at crascit.com (Craig Scott) Date: Fri, 19 Jan 2018 23:30:56 +1100 Subject: [cmake-developers] XXX_FLAGS_INIT applied inconsistently Message-ID: I'm looking at the way the various XXX_FLAGS_INIT variables are handled across the different compilers and platforms. These are set in many files in the Modules/Compilers, Modules/Platforms and Modules directories. There seems to be a couple of problems with what I'm seeing: - In most cases, the various files are appending rather than prepending to the existing contents of the XXX_FLAGS_INIT variables. This means any values developers provide cannot override the default ones because later flags usually take precedence over earlier ones. - Some platforms and compilers (e.g. IRIX, Windows-df, Generic-SDCC-C, OSF1, CSharp flags) unilaterally set XXX_FLAGS_INIT variables. This would discard any values a developer might set in a toolchain file, for example. Since I don't know much about the history of all these, I was wondering if there was any technical reason why the logic works this way? As things stand, it can be difficult for developers to provide their own XXX_FLAGS_INIT variables to customise things if they are overridden by the defaults CMake provides. -- Craig Scott Melbourne, Australia https://crascit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Fri Jan 19 09:01:15 2018 From: brad.king at kitware.com (Brad King) Date: Fri, 19 Jan 2018 09:01:15 -0500 Subject: [cmake-developers] CMAKE :: mingw make files with response file for includes In-Reply-To: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> References: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> Message-ID: On 01/17/2018 03:52 AM, Jayakumar, Lenindarbi wrote: > Response file link flag ?CMAKE_C_RESPONSE_FILE_LINK_FLAG? is not customizable > for include paths. > The @ symbol is hardcoded in ?cmMakefileTargetGenerator::AddIncludeFlags? In case the compiler and link driver want different response file flags, one could add a separate "CMAKE__RESPONSE_FILE_COMPILE_FLAG" variable to use for include flags. See https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst for contribution instructions if you'd like to work on it. Thanks, -Brad From brad.king at kitware.com Fri Jan 19 09:07:44 2018 From: brad.king at kitware.com (Brad King) Date: Fri, 19 Jan 2018 09:07:44 -0500 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator In-Reply-To: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> References: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> Message-ID: <969bf88a-d42e-1f71-91f0-744bd10573d3@kitware.com> On 01/17/2018 04:14 PM, Claus Klein wrote: > 1.) Is ist possible to change the object or/and the dependency file > name generated for ninja? No one has needed to before because currently-supported compilers all have options to specify the output file name. > 2.) Why generates cmake the objectname as sourcefilename.{c,cpp}.obj? We support adding `src.c` and `src.cxx` together. The object file names need to be distinct. > WindRiver sets the dep file name to objectDir/SourceName.d, so the ".obj" > in "DEP_FILE = path/BaseName.c.obj.d" must be removed > Armcc just uses base name in the same directory as the command runs, > "BaseName.d". Possible approaches to deal with this include: * Extend the Ninja generator with settings to tell it about the above names. * Set `CMAKE__COMPILE_OBJECT` to contain a follow-up command after compiling to rename the compiler-produced depfile and move it to where Ninja wants to see it. Either way there could be problems with source files with the same base name compiling at the same time and overwriting each other's depfiles. Ideally the compilers should be fixed instead. -Brad From brad.king at kitware.com Fri Jan 19 09:15:32 2018 From: brad.king at kitware.com (Brad King) Date: Fri, 19 Jan 2018 09:15:32 -0500 Subject: [cmake-developers] XXX_FLAGS_INIT applied inconsistently In-Reply-To: References: Message-ID: <378657a6-f986-2c86-0ecc-206fa2ed0fd2@kitware.com> On 01/19/2018 07:30 AM, Craig Scott wrote: > * In most cases, the various files are appending rather than prepending > to the existing contents of the XXX_FLAGS_INIT variables. It was once just setting them. The `_INIT` variables were not originally meant to be set by project code or toolchain files at all. Only recently did we switch to appending and document them for toolchain files. The intended purpose is to accumulate *independent* flags from various sources of knowledge. Users can set the `XXX_FLAGS` cache entries directly to override whatever CMake would initialize them to. Once they are set the `_INIT` variables are ignored. > * Some platforms and compilers (e.g. IRIX, Windows-df, Generic-SDCC-C, > OSF1, CSharp flags) unilaterally set XXX_FLAGS_INIT variables. > This would discard any values a developer might set in a toolchain file, > for example. These are leftovers that were never converted to the append approach. IRIX, OSF1, and Windows-df haven't been used in years AFAIK and could likely be removed. Otherwise, see above. -Brad From Lenindarbi.Jayakumar at magna.com Fri Jan 19 09:25:47 2018 From: Lenindarbi.Jayakumar at magna.com (Jayakumar, Lenindarbi) Date: Fri, 19 Jan 2018 14:25:47 +0000 Subject: [cmake-developers] CMAKE :: mingw make files with response file for includes In-Reply-To: References: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> Message-ID: <9b8d0299658140fcaf358ec5401790a0@FRAMSEX06.magna.global> Thanks for the reply. It is not compiler and linker. I have to use response file for both includes and objects. Tasking compiler expects -f as Response file link flag for both. But cmake produces command line for objects using -f and includes using @. I prefer to get it fixed in generator. Unfortunately I don't have enough time and experience. Perhaps an cmake expert could confirm and fix it. Possible cause: The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" function in file ../Source/cmMakefileTargetGenerator.cxx if (useResponseFile) { std::string name = "includes_"; name += lang; name += ".rsp"; std::string arg = "@" + this->CreateResponseFile(name.c_str(), includeFlags, this->FlagFileDepends[lang]); this->LocalGenerator->AppendFlags(flags, arg); } However, the implementation should be like in "cmMakefileTargetGenerator::CreateObjectLists" function. // Lookup the response file reference flag. std::string responseFlagVar = "CMAKE_"; responseFlagVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName); responseFlagVar += "_RESPONSE_FILE_LINK_FLAG"; const char* responseFlag = this->Makefile->GetDefinition(responseFlagVar); if (!responseFlag) { responseFlag = "@"; } Thanks, Lenin -----Original Message----- From: Brad King [mailto:brad.king at kitware.com] Sent: Freitag, 19. Januar 2018 15:01 To: Jayakumar, Lenindarbi ; cmake-developers at cmake.org Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes On 01/17/2018 03:52 AM, Jayakumar, Lenindarbi wrote: > Response file link flag "CMAKE_C_RESPONSE_FILE_LINK_FLAG" is not > customizable for include paths. > The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" In case the compiler and link driver want different response file flags, one could add a separate "CMAKE__RESPONSE_FILE_COMPILE_FLAG" variable to use for include flags. See https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst for contribution instructions if you'd like to work on it. Thanks, -Brad From brad.king at kitware.com Mon Jan 22 07:54:07 2018 From: brad.king at kitware.com (Brad King) Date: Mon, 22 Jan 2018 07:54:07 -0500 Subject: [cmake-developers] CMAKE :: mingw make files with response file for includes In-Reply-To: <9b8d0299658140fcaf358ec5401790a0@FRAMSEX06.magna.global> References: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> <9b8d0299658140fcaf358ec5401790a0@FRAMSEX06.magna.global> Message-ID: <4116c2b7-24a9-6399-70bb-5850eb060002@kitware.com> On 01/19/2018 09:25 AM, Jayakumar, Lenindarbi wrote: > I have to use response file for both includes and objects. > Tasking compiler expects -f as Response file link flag for both. > But cmake produces command line for objects using -f and includes using @. > > I prefer to get it fixed in generator. Yes, that use of `@` should be made configurable. I'll take a look when I get a chance. Thanks, -Brad From Lenindarbi.Jayakumar at magna.com Mon Jan 22 08:43:53 2018 From: Lenindarbi.Jayakumar at magna.com (Jayakumar, Lenindarbi) Date: Mon, 22 Jan 2018 13:43:53 +0000 Subject: [cmake-developers] CMAKE :: mingw make files with response file for includes In-Reply-To: <4116c2b7-24a9-6399-70bb-5850eb060002@kitware.com> References: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> <9b8d0299658140fcaf358ec5401790a0@FRAMSEX06.magna.global> <4116c2b7-24a9-6399-70bb-5850eb060002@kitware.com> Message-ID: <528b80d7e756452eacca8981f3cb1527@FRAMSEX06.magna.global> Sounds good. Thank you Brad. Gr??e Lenin -----Original Message----- From: Brad King [mailto:brad.king at kitware.com] Sent: Montag, 22. Januar 2018 13:54 To: Jayakumar, Lenindarbi ; cmake-developers at cmake.org Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes On 01/19/2018 09:25 AM, Jayakumar, Lenindarbi wrote: > I have to use response file for both includes and objects. > Tasking compiler expects -f as Response file link flag for both. > But cmake produces command line for objects using -f and includes using @. > > I prefer to get it fixed in generator. Yes, that use of `@` should be made configurable. I'll take a look when I get a chance. Thanks, -Brad From isaiah.norton at gmail.com Mon Jan 22 10:54:25 2018 From: isaiah.norton at gmail.com (Isaiah Norton) Date: Mon, 22 Jan 2018 10:54:25 -0500 Subject: [cmake-developers] Server handshake with only build directory Message-ID: I'd like to use cmake server with only a build directory argument (mostly in order to query the cache), but receive an error in return: ``` > cmake --version cmake version 3.9.4 > cmake -E server --experimental --debug > [== "CMake Server" ==[ > {"cookie":"zimtstern","type":"handshake","protocolVersion":{"major":1}, > "buildDirectory":"/opt/bld/s5nj/Slicer-build" > } > ]== "CMake Server" ==] [== "CMake Server" ==[ {"cookie":"zimtstern","errorMessage":"Failed to activate protocol version: \"CMAKE_HOME_DIRECTORY\" is set but incompatible with configured source directory value.","inReplyTo":"handshake","type":"error"} ]== "CMake Server" ==] ``` The docs example with source and generator arguments works -- but shouldn't the build directory fully determine these options for an already-configured build tree? Thanks, Isaiah -------------- next part -------------- An HTML attachment was scrubbed... URL: From tobias.hunger at gmail.com Mon Jan 22 11:04:28 2018 From: tobias.hunger at gmail.com (Tobias Hunger) Date: Mon, 22 Jan 2018 17:04:28 +0100 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: Message-ID: Hi Isaiah, the idea was to make sure the IDE and cmake agree on the settings being used and to make it very explicit what is going to be used. Best Regards, Tobias On Mon, Jan 22, 2018 at 4:54 PM, Isaiah Norton wrote: > I'd like to use cmake server with only a build directory argument (mostly in > order to query the cache), but receive an error in return: > > ``` >> cmake --version > cmake version 3.9.4 > >> cmake -E server --experimental --debug > >> [== "CMake Server" ==[ >> {"cookie":"zimtstern","type":"handshake","protocolVersion":{"major":1}, >> "buildDirectory":"/opt/bld/s5nj/Slicer-build" >> } >> ]== "CMake Server" ==] > > [== "CMake Server" ==[ > {"cookie":"zimtstern","errorMessage":"Failed to activate protocol version: > \"CMAKE_HOME_DIRECTORY\" is set but incompatible with configured source > directory value.","inReplyTo":"handshake","type":"error"} > ]== "CMake Server" ==] > ``` > > The docs example with source and generator arguments works -- but shouldn't > the build directory fully determine these options for an already-configured > build tree? > > Thanks, > Isaiah > > > -- > > 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: > https://cmake.org/mailman/listinfo/cmake-developers > From isaiah.norton at gmail.com Mon Jan 22 11:43:03 2018 From: isaiah.norton at gmail.com (Isaiah Norton) Date: Mon, 22 Jan 2018 11:43:03 -0500 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: Message-ID: Hi Tobias, That makes sense when the goal is the IDE driving the configuration. But I'm not trying to use this for the IDE to drive the configuration, I only want to query the build directory in order for the IDE to learn about it. AFAIK the only way to change either one of these properties is to delete the build and start over, so again, they should be fully-determined in a configured directory. Isaiah On Mon, Jan 22, 2018 at 11:04 AM, Tobias Hunger wrote: > Hi Isaiah, > > the idea was to make sure the IDE and cmake agree on the settings > being used and to make it very explicit what is going to be used. > > Best Regards, > Tobias > > On Mon, Jan 22, 2018 at 4:54 PM, Isaiah Norton > wrote: > > I'd like to use cmake server with only a build directory argument > (mostly in > > order to query the cache), but receive an error in return: > > > > ``` > >> cmake --version > > cmake version 3.9.4 > > > >> cmake -E server --experimental --debug > > > >> [== "CMake Server" ==[ > >> {"cookie":"zimtstern","type":"handshake","protocolVersion":{"major":1}, > >> "buildDirectory":"/opt/bld/s5nj/Slicer-build" > >> } > >> ]== "CMake Server" ==] > > > > [== "CMake Server" ==[ > > {"cookie":"zimtstern","errorMessage":"Failed to activate protocol > version: > > \"CMAKE_HOME_DIRECTORY\" is set but incompatible with configured source > > directory value.","inReplyTo":"handshake","type":"error"} > > ]== "CMake Server" ==] > > ``` > > > > The docs example with source and generator arguments works -- but > shouldn't > > the build directory fully determine these options for an > already-configured > > build tree? > > > > Thanks, > > Isaiah > > > > > > -- > > > > 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: > > https://cmake.org/mailman/listinfo/cmake-developers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rchiodo at microsoft.com Mon Jan 22 11:48:33 2018 From: rchiodo at microsoft.com (Rich Chiodo) Date: Mon, 22 Jan 2018 16:48:33 +0000 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: Message-ID: If you have the build directory, can?t you just parse the CmakeCache.txt? CMAKE_HOME_DIRECTORY in the cache is the source folder. Seems easier than writing something to talk to CMake server. From: cmake-developers [mailto:cmake-developers-bounces at cmake.org] On Behalf Of Isaiah Norton Sent: Monday, January 22, 2018 8:43 AM To: Tobias Hunger Cc: CMake Developers Subject: Re: [cmake-developers] Server handshake with only build directory Hi Tobias, That makes sense when the goal is the IDE driving the configuration. But I'm not trying to use this for the IDE to drive the configuration, I only want to query the build directory in order for the IDE to learn about it. AFAIK the only way to change either one of these properties is to delete the build and start over, so again, they should be fully-determined in a configured directory. Isaiah On Mon, Jan 22, 2018 at 11:04 AM, Tobias Hunger > wrote: Hi Isaiah, the idea was to make sure the IDE and cmake agree on the settings being used and to make it very explicit what is going to be used. Best Regards, Tobias On Mon, Jan 22, 2018 at 4:54 PM, Isaiah Norton > wrote: > I'd like to use cmake server with only a build directory argument (mostly in > order to query the cache), but receive an error in return: > > ``` >> cmake --version > cmake version 3.9.4 > >> cmake -E server --experimental --debug > >> [== "CMake Server" ==[ >> {"cookie":"zimtstern","type":"handshake","protocolVersion":{"major":1}, >> "buildDirectory":"/opt/bld/s5nj/Slicer-build" >> } >> ]== "CMake Server" ==] > > [== "CMake Server" ==[ > {"cookie":"zimtstern","errorMessage":"Failed to activate protocol version: > \"CMAKE_HOME_DIRECTORY\" is set but incompatible with configured source > directory value.","inReplyTo":"handshake","type":"error"} > ]== "CMake Server" ==] > ``` > > The docs example with source and generator arguments works -- but shouldn't > the build directory fully determine these options for an already-configured > build tree? > > Thanks, > Isaiah > > > -- > > 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: > https://cmake.org/mailman/listinfo/cmake-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From isaiah.norton at gmail.com Mon Jan 22 12:01:27 2018 From: isaiah.norton at gmail.com (Isaiah Norton) Date: Mon, 22 Jan 2018 12:01:27 -0500 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: Message-ID: Sure... But my understanding is that the goal of the server was to give people an alternative to doing that. From the cmake-server docs: 3. Provide a stable interface for reading the information in the CMake > cache. On Mon, Jan 22, 2018 at 11:48 AM, Rich Chiodo wrote: > If you have the build directory, can?t you just parse the CmakeCache.txt? > CMAKE_HOME_DIRECTORY in the cache is the source folder. Seems easier than > writing something to talk to CMake server. > > > > > > *From:* cmake-developers [mailto:cmake-developers-bounces at cmake.org] *On > Behalf Of *Isaiah Norton > *Sent:* Monday, January 22, 2018 8:43 AM > *To:* Tobias Hunger > *Cc:* CMake Developers > *Subject:* Re: [cmake-developers] Server handshake with only build > directory > > > > Hi Tobias, > > > > That makes sense when the goal is the IDE driving the configuration. But > I'm not trying to use this for the IDE to drive the configuration, I only > want to query the build directory in order for the IDE to learn about it. > AFAIK the only way to change either one of these properties is to delete > the build and start over, so again, they should be fully-determined in a > configured directory. > > > > Isaiah > > > > On Mon, Jan 22, 2018 at 11:04 AM, Tobias Hunger > wrote: > > Hi Isaiah, > > the idea was to make sure the IDE and cmake agree on the settings > being used and to make it very explicit what is going to be used. > > Best Regards, > Tobias > > > On Mon, Jan 22, 2018 at 4:54 PM, Isaiah Norton > wrote: > > I'd like to use cmake server with only a build directory argument > (mostly in > > order to query the cache), but receive an error in return: > > > > ``` > >> cmake --version > > cmake version 3.9.4 > > > >> cmake -E server --experimental --debug > > > >> [== "CMake Server" ==[ > >> {"cookie":"zimtstern","type":"handshake","protocolVersion":{"major":1}, > >> "buildDirectory":"/opt/bld/s5nj/Slicer-build" > >> } > >> ]== "CMake Server" ==] > > > > [== "CMake Server" ==[ > > {"cookie":"zimtstern","errorMessage":"Failed to activate protocol > version: > > \"CMAKE_HOME_DIRECTORY\" is set but incompatible with configured source > > directory value.","inReplyTo":"handshake","type":"error"} > > ]== "CMake Server" ==] > > ``` > > > > The docs example with source and generator arguments works -- but > shouldn't > > the build directory fully determine these options for an > already-configured > > build tree? > > > > Thanks, > > Isaiah > > > > > > > -- > > > > 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: > > https://cmake.org/mailman/listinfo/cmake-developers > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tobias.hunger at gmail.com Tue Jan 23 04:55:13 2018 From: tobias.hunger at gmail.com (Tobias Hunger) Date: Tue, 23 Jan 2018 10:55:13 +0100 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: Message-ID: Hi Rich, On Mon, Jan 22, 2018 at 5:48 PM, Rich Chiodo wrote: > If you have the build directory, can?t you just parse the CmakeCache.txt? > CMAKE_HOME_DIRECTORY in the cache is the source folder. Seems easier than > writing something to talk to CMake server. Sure, but part of the reason to have server-mode is to get rid of clutches like that. If nobody objects, then I can make server-mode start with a build directory only. I had that implemented at some point, but removed it as part of the review process. Any objections from the core team about enabling server-mode with a build directory only? I can send in a patch, it is simple to add this. Best Regards, Tobias From brad.king at kitware.com Tue Jan 23 06:40:41 2018 From: brad.king at kitware.com (Brad King) Date: Tue, 23 Jan 2018 06:40:41 -0500 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: Message-ID: <03a0e920-cb61-9051-0bd6-cb8aaac08d35@kitware.com> On 01/23/2018 04:55 AM, Tobias Hunger wrote: > Any objections from the core team about enabling server-mode with a > build directory only? I can send in a patch, it is simple to add this. Fine with me. This should be allowed only when the build tree already exists. Thanks, -Brad From isaiah.norton at gmail.com Tue Jan 23 10:16:19 2018 From: isaiah.norton at gmail.com (Isaiah Norton) Date: Tue, 23 Jan 2018 10:16:19 -0500 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: <03a0e920-cb61-9051-0bd6-cb8aaac08d35@kitware.com> References: <03a0e920-cb61-9051-0bd6-cb8aaac08d35@kitware.com> Message-ID: > > > Any objections from the core team about enabling server-mode with a > > build directory only? I can send in a patch, it is simple to add this. > > Fine with me. > Awesome, thanks. Please cc me (@ihnorton). Isaiah On Tue, Jan 23, 2018 at 6:40 AM, Brad King wrote: > On 01/23/2018 04:55 AM, Tobias Hunger wrote: > > Any objections from the core team about enabling server-mode with a > > build directory only? I can send in a patch, it is simple to add this. > > Fine with me. > > This should be allowed only when the build tree already exists. > > 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: > https://cmake.org/mailman/listinfo/cmake-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rchiodo at microsoft.com Tue Jan 23 11:40:39 2018 From: rchiodo at microsoft.com (Rich Chiodo) Date: Tue, 23 Jan 2018 16:40:39 +0000 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: <03a0e920-cb61-9051-0bd6-cb8aaac08d35@kitware.com> Message-ID: Tobias, can you make sure it still supports passing the source directory too? Otherwise we?ll have to have version dependent arguments that we pass to CMake server. From: Isaiah Norton [mailto:isaiah.norton at gmail.com] Sent: Tuesday, January 23, 2018 7:16 AM To: Brad King Cc: Tobias Hunger ; Rich Chiodo ; CMake Developers Subject: Re: [cmake-developers] Server handshake with only build directory > Any objections from the core team about enabling server-mode with a > build directory only? I can send in a patch, it is simple to add this. Fine with me. Awesome, thanks. Please cc me (@ihnorton). Isaiah On Tue, Jan 23, 2018 at 6:40 AM, Brad King > wrote: On 01/23/2018 04:55 AM, Tobias Hunger wrote: > Any objections from the core team about enabling server-mode with a > build directory only? I can send in a patch, it is simple to add this. Fine with me. This should be allowed only when the build tree already exists. 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: https://cmake.org/mailman/listinfo/cmake-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Wed Jan 24 10:45:50 2018 From: brad.king at kitware.com (Brad King) Date: Wed, 24 Jan 2018 10:45:50 -0500 Subject: [cmake-developers] CMAKE :: mingw make files with response file for includes In-Reply-To: <4116c2b7-24a9-6399-70bb-5850eb060002@kitware.com> References: <869a0ca961ff4ba58ec22a3cf4c93493@FRAMSEX06.magna.global> <9b8d0299658140fcaf358ec5401790a0@FRAMSEX06.magna.global> <4116c2b7-24a9-6399-70bb-5850eb060002@kitware.com> Message-ID: <54711f1c-8c8f-3911-1d15-9b32c9158ca1@kitware.com> On 01/22/2018 07:54 AM, Brad King wrote: > Yes, that use of `@` should be made configurable. > > I'll take a look when I get a chance. The IBM XL compiler needs this too to use `-qoptfile=`. See fix here: https://gitlab.kitware.com/cmake/cmake/merge_requests/1691 -Brad From alan.rushforth at gmail.com Wed Jan 24 11:22:54 2018 From: alan.rushforth at gmail.com (Alan Rushforth) Date: Wed, 24 Jan 2018 16:22:54 +0000 Subject: [cmake-developers] Adding support for C# shared projects Message-ID: Hello, I am currently working on adding support for C# shared projects to CMake, as I have a project which uses them heavily which I would like to migrate to CMake. Shared projects are are effectively a bag of source files, which can be used in other projects but which have no direct compilation output. The best workaround for the lack of support I have found so far is to use "VS_CSHARP_Link" to include all the source files that would have been in the shared project in each project that referenced it. This works but the result in VS is pretty ugly and unintuitive, particularly if you are using the shared project concept heavily and end up with hundreds of identical source files linked into every project, hence my desire add proper support. Instead of a .csproj file, shared projects have both a .shproj and .projitems file. The content of both is effectively a stripped down .csproj file so I have been able to reuse a lot of the .csproj generation code to create these. What I would like people's suggestions on is the best way of a user specifying they want a shared project rather than a normal class library. I have implemented a "working" patch based on a new boolean target property "VS_DOTNET_SHARED_PROJECT" but having read other issues I'm aware Michael St?rmer likes to minimise these properties. Therefore I am interested in people's opinions as to whether this is an acceptable approach, or what a better approach might be. The other option I thought of was to use the STATIC flag of the "add_library" command, as C# doesn't differentiate between STATIC and SHARED libraries and shared projects are conceptually similar(ish) to STATIC libraries. Personally I think this second approach might be muddying concepts and therefore cause confusion but am interested in any thoughts or other ideas. Cheers, Alan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tobias.hunger at gmail.com Wed Jan 24 11:29:06 2018 From: tobias.hunger at gmail.com (Tobias Hunger) Date: Wed, 24 Jan 2018 17:29:06 +0100 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: <03a0e920-cb61-9051-0bd6-cb8aaac08d35@kitware.com> Message-ID: Hello, Daniel has beaten me to the punch: 187332b2fa169056a2c3682d9a7628d872b2d49b makes everything but the build directory optional. Looks like we need to increase the protocol version again:-) I just pushed a couple of patches to polish that patch a bit. Best Regards, Tobias On Tue, Jan 23, 2018 at 5:40 PM, Rich Chiodo wrote: > Tobias, can you make sure it still supports passing the source directory > too? > > > > Otherwise we?ll have to have version dependent arguments that we pass to > CMake server. > > > > From: Isaiah Norton [mailto:isaiah.norton at gmail.com] > Sent: Tuesday, January 23, 2018 7:16 AM > To: Brad King > Cc: Tobias Hunger ; Rich Chiodo > ; CMake Developers > Subject: Re: [cmake-developers] Server handshake with only build directory > > > >> Any objections from the core team about enabling server-mode with a > > >> build directory only? I can send in a patch, it is simple to add this. > > Fine with me. > > > > Awesome, thanks. Please cc me (@ihnorton). > > > > Isaiah > > > > On Tue, Jan 23, 2018 at 6:40 AM, Brad King wrote: > > On 01/23/2018 04:55 AM, Tobias Hunger wrote: >> Any objections from the core team about enabling server-mode with a >> build directory only? I can send in a patch, it is simple to add this. > > Fine with me. > > This should be allowed only when the build tree already exists. > > 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: > https://cmake.org/mailman/listinfo/cmake-developers > > From isaiah.norton at gmail.com Wed Jan 24 15:21:04 2018 From: isaiah.norton at gmail.com (Isaiah Norton) Date: Wed, 24 Jan 2018 15:21:04 -0500 Subject: [cmake-developers] Server handshake with only build directory In-Reply-To: References: <03a0e920-cb61-9051-0bd6-cb8aaac08d35@kitware.com> Message-ID: Thanks! Apologies for missing that; I only tested on 3.9, and apparently missed/overlooked docs-latest. Best, Isaiah On Wed, Jan 24, 2018 at 11:29 AM, Tobias Hunger wrote: > Hello, > > Daniel has beaten me to the punch: > 187332b2fa169056a2c3682d9a7628d872b2d49b makes everything but the > build directory optional. Looks like we need to increase the protocol > version again:-) > > I just pushed a couple of patches to polish that patch a bit. > > Best Regards, > Tobias > > On Tue, Jan 23, 2018 at 5:40 PM, Rich Chiodo > wrote: > > Tobias, can you make sure it still supports passing the source directory > > too? > > > > > > > > Otherwise we?ll have to have version dependent arguments that we pass to > > CMake server. > > > > > > > > From: Isaiah Norton [mailto:isaiah.norton at gmail.com] > > Sent: Tuesday, January 23, 2018 7:16 AM > > To: Brad King > > Cc: Tobias Hunger ; Rich Chiodo > > ; CMake Developers > > Subject: Re: [cmake-developers] Server handshake with only build > directory > > > > > > > >> Any objections from the core team about enabling server-mode with a > > > > > >> build directory only? I can send in a patch, it is simple to add this. > > > > Fine with me. > > > > > > > > Awesome, thanks. Please cc me (@ihnorton). > > > > > > > > Isaiah > > > > > > > > On Tue, Jan 23, 2018 at 6:40 AM, Brad King > wrote: > > > > On 01/23/2018 04:55 AM, Tobias Hunger wrote: > >> Any objections from the core team about enabling server-mode with a > >> build directory only? I can send in a patch, it is simple to add this. > > > > Fine with me. > > > > This should be allowed only when the build tree already exists. > > > > 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: > > https://cmake.org/mailman/listinfo/cmake-developers > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From claus.klein at arcormail.de Sat Jan 27 16:02:57 2018 From: claus.klein at arcormail.de (Claus Klein) Date: Sat, 27 Jan 2018 22:02:57 +0100 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator In-Reply-To: <969bf88a-d42e-1f71-91f0-744bd10573d3@kitware.com> References: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> <969bf88a-d42e-1f71-91f0-744bd10573d3@kitware.com> Message-ID: Hi Brad, I have prepared a patch which works vor cpp files fine. But I have no idea why not for c files? see https://github.com/Kitware/CMake/pull/318 Claus > Am 19.01.2018 um 15:07 schrieb Brad King : > > * Extend the Ninja generator with settings to tell it about the above > names. From cpfeiffer at live.de Sat Jan 27 16:23:53 2018 From: cpfeiffer at live.de (Christian Pfeiffer) Date: Sat, 27 Jan 2018 21:23:53 +0000 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator In-Reply-To: References: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> <969bf88a-d42e-1f71-91f0-744bd10573d3@kitware.com>, Message-ID: Hi Claus, That GitHub repository is a read-only mirror of the GitLab, where all the work takes place: https://gitlab.kitware.com/cmake/cmake . Please see https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst on how to submit merge requests. Chris From: Claus Klein Sent: Saturday, January 27, 2018 10:08 PM To: Brad King Cc: cmake-developers at cmake.org Subject: Re: [cmake-developers] Cannot control the name of dependfile set in Ninja generator Hi Brad, I have prepared a patch which works vor cpp files fine. But I have no idea why not for c files? see https://github.com/Kitware/CMake/pull/318 Claus > Am 19.01.2018 um 15:07 schrieb Brad King : > > * Extend the Ninja generator with settings to tell it about the above > names. -- 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: https://cmake.org/mailman/listinfo/cmake-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From claus.klein at arcormail.de Sun Jan 28 00:44:26 2018 From: claus.klein at arcormail.de (Claus Klein) Date: Sun, 28 Jan 2018 06:44:26 +0100 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator In-Reply-To: References: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> <969bf88a-d42e-1f71-91f0-744bd10573d3@kitware.com> Message-ID: Hi Chris, done, but: commit 4f48fef4 is not allowed because the following files are not formatted according to the 'clang-format-3.8' check: Source/cmNinjaTargetGenerator.cxx. Post a comment ending in the line Do: reformat to rewrite the MR source branch automatically. I have no clang-format? Only xcode installed. Claus > Am 27.01.2018 um 22:23 schrieb Christian Pfeiffer : > > That GitHub repository is a read-only mirror of the GitLab, where all the work takes place:https://gitlab.kitware.com/cmake/cmake . Please seehttps://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst on how to submit merge requests. > > Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.svitok at gmail.com Sun Jan 28 03:03:17 2018 From: jan.svitok at gmail.com (Jano Svitok) Date: Sun, 28 Jan 2018 09:03:17 +0100 Subject: [cmake-developers] Cannot control the name of dependfile set in Ninja generator In-Reply-To: References: <2D71D7E4-F520-4287-9926-AF736B5E7290@arcormail.de> <969bf88a-d42e-1f71-91f0-744bd10573d3@kitware.com> Message-ID: Do as the bot says: post a comment in gitlab that says do:reformat and then pull the branch from gitlab. D?a 28. 1. 2018 6:49 dopoludnia pou??vate? "Claus Klein" < claus.klein at arcormail.de> nap?sal: Hi Chris, done, but: - commit 4f48fef4 is not allowed because the following files are not formatted according to the 'clang-format-3.8' check: Source/cmNinjaTargetGenerator.cxx. Post a comment ending in the line Do: reformat to rewrite the MR source branch automatically. I have no clang-format? Only xcode installed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rchiodo at microsoft.com Wed Jan 31 13:53:39 2018 From: rchiodo at microsoft.com (Rich Chiodo) Date: Wed, 31 Jan 2018 18:53:39 +0000 Subject: [cmake-developers] Adding backtraces to every command Message-ID: We're (Microsoft) investigating tighter integration with CMake -Server and the IDE. One of the things we need is to be able to get the location of where a property is set. CMake has a backtracing capability but it looks to me like properties don't actually keep track of their set location. I think the easiest way for me to do this would be to add a backtrace to every command execute (not 100% sure yet), but I wanted to query the alias for advice 1. Is this a good approach for getting the location of every Set, Link_Libraries, etc? 2. Should I only do this in server mode so as to not affect normal execution with a bunch of extra tracing? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Wed Jan 31 14:42:34 2018 From: brad.king at kitware.com (Brad King) Date: Wed, 31 Jan 2018 14:42:34 -0500 Subject: [cmake-developers] Adding backtraces to every command In-Reply-To: References: Message-ID: Hi Rich, FYI there is discussion about providing backtraces from the server to clients here: https://gitlab.kitware.com/cmake/cmake/issues/17539 It was originally done in CMake 3.10.0 but caused major memory bloat and so was reverted. > One of the things we need is to be able to get the location of where > a property is set. Threading that through everywhere for arbitrary properties will cause too much memory usage. `cmTargetInternals` already has dedicated fields for backtraces of specific properties. Something like that could be added for the properties you need. Can you provide more details about the use case? -Brad From ben.boeckel at kitware.com Wed Jan 31 15:05:51 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Wed, 31 Jan 2018 15:05:51 -0500 Subject: [cmake-developers] Adding backtraces to every command In-Reply-To: References: Message-ID: <20180131200551.GA28421@megas.kitware.com> On Wed, Jan 31, 2018 at 18:53:39 +0000, Rich Chiodo via cmake-developers wrote: > We're (Microsoft) investigating tighter integration with CMake -Server > and the IDE. > > One of the things we need is to be able to get the location of where a > property is set. > > CMake has a backtracing capability but it looks to me like properties > don't actually keep track of their set location. > > I think the easiest way for me to do this would be to add a backtrace > to every command execute (not 100% sure yet), but I wanted to query > the alias for advice > > 1. Is this a good approach for getting the location of every Set, > Link_Libraries, etc? I don't think it'd be sufficient. What would the backtrace for the `custom_prop` variable be in this case? b/CMakeLists.txt: add_library(foo ...) set_property(TARGET foo PROPERTY custom_prop value1) c/CMakeLists.txt (later): set_property(TARGET foo APPEND PROPERTY custom_prop value2) There could be multiple backtraces for each property and when it is overwritten or deleted, should the previous backtraces be cleared out? If appending was done manually using get_property(), list(APPEND), and set_property() that approach would toss information out. --Ben From rchiodo at microsoft.com Wed Jan 31 15:56:43 2018 From: rchiodo at microsoft.com (Rich Chiodo) Date: Wed, 31 Jan 2018 20:56:43 +0000 Subject: [cmake-developers] Adding backtraces to every command In-Reply-To: References: Message-ID: Thanks for the link. I'll respond there. We still have backtraces in our fork, so I'll continue using them for now. Ben had a good point though. I think for our use case, the last value is the one needed. I don't think I can go into more detail other than we want to let the user navigate to where different things are set. -----Original Message----- From: Brad King [mailto:brad.king at kitware.com] Sent: Wednesday, January 31, 2018 11:43 AM To: Rich Chiodo ; CMake Developers Subject: Re: [cmake-developers] Adding backtraces to every command Hi Rich, FYI there is discussion about providing backtraces from the server to clients here: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.kitware.com%2Fcmake%2Fcmake%2Fissues%2F17539&data=02%7C01%7Crchiodo%40microsoft.com%7C378e0befb60641901e2d08d568e2c87c%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636530245598201030&sdata=nVfucgI2ZfXqv519y8NNwj6yRtkdNw1PSw6o%2BBX9wuA%3D&reserved=0 It was originally done in CMake 3.10.0 but caused major memory bloat and so was reverted. > One of the things we need is to be able to get the location of where a > property is set. Threading that through everywhere for arbitrary properties will cause too much memory usage. `cmTargetInternals` already has dedicated fields for backtraces of specific properties. Something like that could be added for the properties you need. Can you provide more details about the use case? -Brad