TomaszAugustyn / call-stack-logger

Call Stack Logger uses function instrumentation to facilitate logging of every function call. Each nesting adds an ident, whereas returning from a function removes it. As the result call stack tree is produced at the runtime giving knowledge of the actual program's flow of execution.
GNU Affero General Public License v3.0
98 stars 29 forks source link

a problem when using cmake replace MakeFile #1

Closed xugaoyi1 closed 2 years ago

xugaoyi1 commented 2 years ago

Hello Tomasz, when I use this program in my program it occur one thing , it seems difficult to define in CMakeLists.txt that guarantee every source file complied with dynamic link bfd, like define in Makefile $(CXX) $(CXXFLAGS) -o $@ $^ -ldl -lbfd. In CMakeLists.txt it can be set CMAKE_CXX_FLAGS but the variant always before source file, but it need link of bfd after the target file. when define in CMakeLists.txt do you have any suggestions ? thanks in advance.

TomaszAugustyn commented 2 years ago

Hello @xugaoyi1 I think you should use "target_link_libraries" in CMake in order to link your target against bfd and dl libraries, so please try: target_link_libraries(<your_target> dl bfd) in your CMakeLists.txt

Let me know if that helps.

xugaoyi1 commented 2 years ago

Hello @TomaszAugustyn. after use target_link_libraries( dl bfd it works. Thanks very much

TomaszAugustyn commented 2 years ago

No problem, glad it works.