toeb / cmakepp

An Enhancement Suite for the CMake Build System
Other
432 stars 37 forks source link

SegFault when overwriting cmake functions #121

Open M1cha opened 8 years ago

M1cha commented 8 years ago

If I override functions like add_library or add_executable, cmake stops with a segfault

example code: macro(add_library _target) _add_library (${_target} ${ARGN}) endmacro()

toeb commented 8 years ago

Hi, Thanks for reporting the issue. Could you tell me on what OS You are? I am assuming Linux . I will try to reproduce it and find a Solution. It might also be a cmake Bug.

M1cha commented 8 years ago

Yes I'm using Linux :)

toeb commented 8 years ago

Hi, sorry its taken so long for a response.

I've tried it on linux and I can't seem to reproduce your error. Is your project available publicly? Then I might be able to debu it to find a solution. However it does seem to me that this is a CMake internal problem where I can only do so much.

toeb commented 8 years ago

Btw when I encounter segfaults in cmake Its usually me creating infinite recursion

M1cha commented 8 years ago

yes it's public: https://github.com/amarullz/libaroma It doesn't use cmakepp atm, ut when u add it and overwrite a internal function(which it currently doesn't do either) it will crash.

I thought about a loop too, but I have no idea how to debug cmake scripts.

toeb commented 8 years ago

well cmake debugging sucks.... because it does not exist :) but I'll try to find your problem as soon as possible. (as this shed light on #118 )

toeb commented 8 years ago

If you not using my function overrides for cmake functions (like add_library, ... etc) you can take them out of the cmakepp source code (if you are using the single file version just remove the function or if you are using the multifile version then delete the function files which are located in cmake/targets/overrides)

This might be a quick fix if you only want to use part of cmakepp (what do you want to use specifically?)

M1cha commented 8 years ago

I want to misuse cmake scripts as my own generator. I want to use cmakepp's template engine to generate Android.mk files and to know what targets etc are defined I need to overwrite pretty much every important cmake function.

toeb commented 8 years ago

Ok. well if you're interested in a quick fix which perform yourself you can just remove any unnecessary functions from cmakepp - template generation does not have many dependencies. I will be looking into it this week.