Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.0 Debug libraries in Code::Blocks  (Read 3052 times)

0 Members and 1 Guest are viewing this topic.

Plaid Phantom

  • Newbie
  • *
  • Posts: 10
    • View Profile
SFML 2.0 Debug libraries in Code::Blocks
« on: October 19, 2012, 04:33:40 am »
Hi, I think I'm missing something.  I recently downloaded SFML 2.0 and ran CMake and compiled the SFML libraries, but I'm confused as to how I should go about generating debug libraries.  There's no option in the "Build Target:" menu for "Debug" as there was in 1.6 (IIRC; it's been a while since I compiled 1.6).  Is there something I need to do to generate debug libraries?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #1 on: October 19, 2012, 07:58:07 am »
You just need to set CMAKE_BUILD_TYPE from Release to Debug and then compile everything again.
Also you should always say which compiler you're using. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Plaid Phantom

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #2 on: October 19, 2012, 02:35:49 pm »
Ah, thanks. I knew it would be something simple like that. I thought I had said I was using Code::Blocks (w/MinGW), but I guess I didn't. Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #3 on: October 19, 2012, 02:48:49 pm »
I thought I had said I was using Code::Blocks (w/MinGW), but I guess I didn't.
I just now saw again that you specified Code::Blocks in the title, which usually implies MinGW, but it's also not always the case, so it's better to specify the actual compiler instead of just the IDE. ;)

Also if you had read the official tutorial you'd have already had that information... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #4 on: October 19, 2012, 03:02:07 pm »
Quote
I just now saw again that you specified Code::Blocks in the title, which usually implies MinGW, but it's also not always the case, so it's better to specify the actual compiler instead of just the IDE.
We don't really care about the compiler here, it's just a CMake and/or IDE issue.

Quote
Also if you had read the official tutorial you'd have already had that information...
In fact, CMake is able to generate multi-configuration projects for IDEs that support it. Code::Blocks does (like almost any IDE), so I'm surprised CMake didn't do it.
Laurent Gomila - SFML developer

Plaid Phantom

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #5 on: October 19, 2012, 04:02:02 pm »
Also if you had read the official tutorial you'd have already had that information... ;)
I read it...at some point...  ;)

Quote from: The Tutorial
Note that if you generate a workspace for an IDE that supports multiple configurations, such as Visual Studio, [CMAKE_BUILD_TYPE] is ignored and you automatically get all the available build types in it.

Yeah, this makes it sound like CMake should just provide "Debug" as a build target in my Code::Blocks project.  Is it working for anyone else?  I'll try to play with it over the weekend.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #6 on: October 19, 2012, 04:09:11 pm »
In fact (after Googling a bit), the Code::Blocks generator of CMake is makefile-based, which means that it can't handle multi-configuration projects although Code::Blocks supports that.

The only multi-configuration generators in CMake are Visual Studio and XCode.

So yes, you must run CMake once for each configuration. But don't use Code::Blocks, since it's just for compiling SFML (not editing its source code), direct MinGW makefiles are simpler and more efficient, don't bother with an IDE.
« Last Edit: October 19, 2012, 04:11:10 pm by Laurent »
Laurent Gomila - SFML developer

Plaid Phantom

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #7 on: October 19, 2012, 04:18:22 pm »
That all still seems weird, since as I understand it make (at least, linux make) does support targets, i.e. "make install", "make debug", "make clean".  But at this point it's a problem for CMake.  Thanks for the help!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Debug libraries in Code::Blocks
« Reply #8 on: October 19, 2012, 04:32:13 pm »
Targets are used for real targets, not for configurations. Don't forget that you can have several libraries / executables inside a single CMake project. So for example, for SFML the targets will be sfml-system, sfml-window, sfml-audio, ..., sfml-opengl, sfml-pong, sfml-shaders, ..., sfml-doc. Not "debug" and "release".

This is also explained in the CMake tutorial.
Laurent Gomila - SFML developer

 

anything