-
Notifications
You must be signed in to change notification settings - Fork 6
Home
From an email I've sent to someone interested in collaboration: A quick run-down of where things are at!
Thanks for your interest! I tried to post to as many places as possible to make sure anyone looking for something for FASTbuild/Cmake would be able to look me up. The last thing I want is multiple efforts underway!|
I'd welcome any help you can offer, including if you want to offer feedback thats just as welcome. I should add that I'm in Australia, so any times that I talk about here (morning/night) are all relative to Australia. I generally work on Cmake at night when I have the time.
At this stage I'm still slowly working to get all the UnitTests passing - currently 60/~370 are failing. Those unit tests are with the MSVC compiler/linker + Fastbuild.
Most of the unit tests that are failing require me to implement "Custom Build Steps" which I have not done yet. Another thing I haven't done is pre-compiled-headers. These make up most of the remaining unit test failures I believe (or are at least part of the problem)
Once the unit tests are successful, the intention is to then create a Visual Studio "cmExtraGenerator" that way we can display projects/makefile projects/fastbuild projects within visual studio still. I haven't started on that part of it at all, and it could be a parallel endeavour.
The code I'm working with is here: https://github.com/inbilla/CMake/tree/fastbuild-attempt1 it's not completely up to date, as I haven't sunk the latest changes from a laptop that I took overseas with me recently. So I'll make sure I do that in the morning. I recommend starting with the code that I will sync in the morning before making too many changes. But you can certainly get up to speed with how to use it with what is there already... I recommend perhaps forking my repository then you can send me pull requests with any changes you need put in? Does that work for you? Would you prefer to work in my repository directly?
How familiar are you with CMake? How about FASTBuild?
I can give you a quick rundown of the code here... Most/All of the functionality is inside cmGlobalFastbuildGenerator.cxx. I'm actually not a fan of the way the other Cmake generators are written, the interfaces and the code paths are very difficult to follow. As such, I've attempted to write this generator in a way that makes sense to me (to make things as clear as possible, I've tried to hide all implementation as much as possible, so I can see where the application interacts with the outside world). Some of the interfaces that are 'required' in this way exist inside cmLocalFastbuildgenerator.cxx. Most of the functions there are virtual overrides to slightly modify the behaviour of some of the internals of the cmake process at various stages.
In terms of getting it running.... I've setup my environment as follows: Cmake-dev/Cmake - git clone of the repository Cmake-dev/fastbuild - a copy of the fastbuild binaries downloaded from the website Cmake-dev/build - Run Cmake binary over the Cmake repository and generate the build files here. (I use Visual studio for normal dev, so thats what is in this folder). I use this to do all the general development.
Once you've set this all up, then you want to make a new Cmake binary using Visual studio, or whatever your current build system of choice is. After you've done that, you then have a Cmake binary that supports some amount of Fastbuild.
At this point, I've been doing a bunch of testing of the build process WITH the CMake project itself. This is also how I run the normal CMake unit tests. So now you need to setup your environment for Cmake/Fastbuild/Compiler of choice (MSVC at this point).
If you're using Visual studio, best thing is to run the Visual Studio command line link, that sets up all the visual studio environment variables. Once you've done that, you'll want to add the fastbuild directory above to your PATH environment variable. Now you'll be able to run CL.exe and Fbuild.exe on the command line and it should be able to find the right commands.
At this point, I now generate this directory: Cmake-dev/build-fastbuild To do this, you simply run: build/bin/Debug/cmake.exe -G Fastbuild ../Cmake This will then generate a Fastbuild project that will be able to build CMake itself. To build it, you use: "FBuild -config CMake.bff Debug" - (One of my latest commits actually removes the need to use the "-config" option. you can get that in the morning).
So now you've successfully built a binary of CMake using Fastbuild! So I imagine this is enough for some of the more simple CMake projects out there - in which case, you probably have a working version of the binary that you can use. But for others with more complex configurations, we're going to have to implement the full details of the Cmake system.
To achieve this we obviously need to run Unit Tests...
This is done by navigating to the build-fastbuild directory. Then running "bin/Debug/ctest -C Debug" This will run all tests and generate results.
To run a specific test - say test number 35: "bin/Debug/ctest -C Debug -I 35,35" To get some more detailed output about how the test ran, use the "-V" parameter.
When a test fails, I usually read the detailed output and workout what happened
- did the generation fail? (debug the fbuild generation)
- did the fastbuild syntax fail? (debug the .bff file to see why it generated incorrectly).
- did the source fail to build? (debug why the .bff file failed to apply the needed parameters - usually compile options of preprocessor directives have been lost or invalid somewhere)
- Was a source file missing? (generally means the source file was to be generated in a custom build step - I haven't written this feature yet)
- Sometimes I need to go looking at the CMakeLists.txt for the test that ran (you can see which one when you use -V) that usually gives you more of an idea of what the test is trying to achieve.
Lots of info, Let me know if you need any help or have any feedback!
I've copied this write up into the wiki on my repository so we can adjust the steps for future helpers. I've got a number of people interested in helping out, though no contributions yet.