Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Usage with CMake based build setups
#1
I wanted to ask if there are any pointers on working with CMake based build pipelines?
I imagine this would work with the standard workflow if cmake could be triggered on a recompile, but right now that only is possible with the external build tool feature, which would then mean manually parsing all the required files or generated solutions to find the changes.
Reply
#2
CMake doesn't have to be triggered on a recompile.
Even though CMake does the initial build, the PDB files produced store enough information for Live++ to know which compiler needs to be invoked upon a recompile.

There should be no need for you to use the external build system mode in this scenario, default mode should be fine.
Reply
#3
For general recompilation this of course works fine, the problem arises when new h/cpp files are added to the cmake files.
Since the pre-build step isnt invoked, these wont make it into the new generated solution or compilation units.
Unless of course adding new files isnt supported.
Reply
#4
(10-07-2020, 12:09 PM)sunnlok Wrote: For general recompilation this of course works fine, the problem arises when new h/cpp files are added to the cmake files.
Since the pre-build step isnt invoked, these wont make it into the new generated solution or compilation units.
Unless of course adding new files isnt supported.

You are correct, adding new files is not supported in the default mode.

The reason for that is the following: in order to recompile files, Live++ needs to know both the compiler executable and the exact compiler options used for compiling the file. As this information is also extracted from the PDB file, it isn't available yet when the file is being added to the CMake project.

At the moment, adding new files is only possible in External Build System mode. In this mode, you can inject code from any .obj file, no matter if it is an existing or new file.

For supporting your use case, Live++ would need dedicated CMake support, so it knows how to "talk" to CMake.
This might be added in a future version of Live++, along with support for other build systems such as FASTBuild as well.
Reply
#5
Is there any way to query data thats stored inside the pdbs via Live++?
That would be helpfull to find out information about source paths and other things like changed/added functions.
Reply
#6
(10-08-2020, 11:02 AM)sunnlok Wrote: Is there any way to query data thats stored inside the pdbs via Live++?
That would be helpfull to find out information about source paths and other things like changed/added functions.

No, unfortunately there is no way to query any data from Live++.
What would you like to do?
Reply
#7
For example the compiler that was used for a module, where the source files are and maybe information about new functions or classes.
Right now to get that info i would need to consume the pdb com api myself while live++ technically already should have access to that info.

I assume global static objects arent constructed when live++ patches the module? The ones that would usually be created when a module is loaded.
Having the ability to somehow instantiate newly added objects or invoke new functions would also be pretty amazing since a lot of "automatic" registration and reflection is run that way in my code.
Reply
#8
Live++ calls the dynamic initializer functions created by the compiler, so all objects that need a global constructor to be called will be properly initialized when patching a module.

The only thing that is not supported is adding automatic thread-local storage variables to a patch.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)