Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegFault when overwriting cmake functions #121

Open
M1cha opened this issue Jul 25, 2015 · 9 comments
Open

SegFault when overwriting cmake functions #121

M1cha opened this issue Jul 25, 2015 · 9 comments
Milestone

Comments

@M1cha
Copy link

M1cha commented Jul 25, 2015

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()

@M1cha M1cha changed the title SegFault when overriding cmake functions SegFault when overwriting cmake functions Jul 25, 2015
@toeb
Copy link
Owner

toeb commented Jul 26, 2015

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
Copy link
Author

M1cha commented Jul 26, 2015

Yes I'm using Linux :)

@toeb
Copy link
Owner

toeb commented Aug 3, 2015

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
Copy link
Owner

toeb commented Aug 3, 2015

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

@M1cha
Copy link
Author

M1cha commented Aug 3, 2015

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
Copy link
Owner

toeb commented Aug 5, 2015

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
Copy link
Owner

toeb commented Aug 5, 2015

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
Copy link
Author

M1cha commented Aug 5, 2015

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
Copy link
Owner

toeb commented Aug 5, 2015

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.

@toeb toeb modified the milestone: Stable Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants