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

Author Topic: CSFML and _SYSTEM_ macros  (Read 10003 times)

0 Members and 1 Guest are viewing this topic.

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
CSFML and _SYSTEM_ macros
« on: October 01, 2009, 01:21:13 pm »
Hi laurent!

I just learned CSFML uses it's own System detection Code in Config.h which does not include any FreeBSD at all although some headers check for CSFML_SYSTEM_FREEBSD. Of course this can be adde to CSFML's Config.h as well but I was just wondering why the detection Code is there 2 times and would prefer if CSFML just uses SFML's code -- potentially split into another Header if needed.

Additionally CSFML in sfml2 trunk has a non-existent libdir, it points to CSFML/lib currently so Either a ../ in CSFML/src/SFML/Makefile is missing or a dir in CSFML (/me guesses the first is right)

Regards

Christoph

P.S.: because we're at it, CSFML doesn't build in sfml2 trunk currently

-> http://random.christoph-egger.org/.sfml2-ftbfs-2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CSFML and _SYSTEM_ macros
« Reply #1 on: October 03, 2009, 08:12:41 pm »
Hi Christoph

Quote
although some headers check for CSFML_SYSTEM_FREEBSD

I couldn't find such a header in CSFML. Which one(s) are you talking about?

Quote
Of course this can be adde to CSFML's Config.h as well but I was just wondering why the detection Code is there 2 times and would prefer if CSFML just uses SFML's code

CSFML doesn't (and can't) use C++ SFML headers.
Plus, CSFML's Config.h doesn't define the same things as SFML's one.

Quote
Additionally CSFML in sfml2 trunk has a non-existent libdir, it points to CSFML/lib currently so Either a ../ in CSFML/src/SFML/Makefile is missing or a dir in CSFML (/me guesses the first is right)

Are you talking about the LIBPATH variable? If so, pointing to CSFML/lib is correct.

Quote
because we're at it, CSFML doesn't build in sfml2 trunk currently

Ok, I'll check this :)

Quote
sfml2 trunk

This thing confuses me a lot, please use either "sfml2", "trunk" or "sfml2 and trunk" :lol:
Laurent Gomila - SFML developer

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
CSFML and _SYSTEM_ macros
« Reply #2 on: October 03, 2009, 09:09:30 pm »
Quote from: "Laurent"
Hi Christoph

Quote
although some headers check for CSFML_SYSTEM_FREEBSD

I couldn't find such a header in CSFML. Which one(s) are you talking about?

CSFML/include/SFML/OpenGL.h:45:#elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD)

Additionally there's of couse the buid failure on BSD in csfml
-> CSFML/include/SFML/config.h

Code: [Select]

////////////////////////////////////////////////////////////
// Identify the operating system
////////////////////////////////////////////////////////////
#if defined(_WIN32) || defined(__WIN32__)

    // Windows
    #define CSFML_SYSTEM_WINDOWS

#elif defined(linux) || defined(__linux)

    // Linux
    #define CSFML_SYSTEM_LINUX

#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)

    // MacOS
    #define CSFML_SYSTEM_MACOS

#else

    // Unsupported system
    #error This operating system is not supported by SFML library

#endif

Quote

Quote
Of course this can be adde to CSFML's Config.h as well but I was just wondering why the detection Code is there 2 times and would prefer if CSFML just uses SFML's code

CSFML doesn't (and can't) use C++ SFML headers.
Plus, CSFML's Config.h doesn't define the same things as SFML's one.

Sure but C and C++ can share the OS detection part -> because of that the hint to a separate header. But that's just a suggestion.
Quote

Quote
Additionally CSFML in sfml2 trunk has a non-existent libdir, it points to CSFML/lib currently so Either a ../ in CSFML/src/SFML/Makefile is missing or a dir in CSFML (/me guesses the first is right)

Are you talking about the LIBPATH variable? If so, pointing to CSFML/lib is correct.

OK so it's just the directory to be missing
Quote

Quote
because we're at it, CSFML doesn't build in sfml2 trunk currently

Ok, I'll check this :)

Quote
sfml2 trunk

This thing confuses me a lot, please use either "sfml2", "trunk" or "sfml2 and trunk" :lol:


Build failure is CSFML sfml2 branch. The BSD stuff is both trunk and sfml2 branch ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CSFML and _SYSTEM_ macros
« Reply #3 on: October 03, 2009, 09:34:10 pm »
Quote
Sure but C and C++ can share the OS detection part -> because of that the hint to a separate header. But that's just a suggestion.

But SFML headers aren't required to use CSFML. If they share one header, one will have to install SFML to use CSFML.

Quote
OK so it's just the directory to be missing

Does it produce an error when building CSFML? If so, there should be the same problem in SFML :)
Laurent Gomila - SFML developer

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
CSFML and _SYSTEM_ macros
« Reply #4 on: October 03, 2009, 11:58:04 pm »
Quote from: "Laurent"
Quote
Sure but C and C++ can share the OS detection part -> because of that the hint to a separate header. But that's just a suggestion.

But SFML headers aren't required to use CSFML. If they share one header, one will have to install SFML to use CSFML.
true maybe manually keeping that part in snyc is a viable way then. YOur choice mostly
Quote

Quote
OK so it's just the directory to be missing

Does it produce an error when building CSFML? If so, there should be the same problem in SFML :)

Ah right, may be that I have code in place for sfml that protects me from that but not in CSFML

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CSFML and _SYSTEM_ macros
« Reply #5 on: October 04, 2009, 09:21:05 am »
Quote
Ah right, may be that I have code in place for sfml that protects me from that but not in CSFML

What can I do to fix this in the makefiles?
Laurent Gomila - SFML developer

christoph

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • http://www.christoph-egger.org
CSFML and _SYSTEM_ macros
« Reply #6 on: October 05, 2009, 02:53:18 pm »
mkdir -p CSFML/lib for CSFML bzw mkdir -p lib in SFML before moving anything to the libdir would do the trick :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CSFML and _SYSTEM_ macros
« Reply #7 on: October 05, 2009, 05:43:06 pm »
Ah, true, this is what I do for the "install" target :lol:

I noticed than for SFML, the "lib" directory was on the SVN repository, that's why you get errors only with CSFML :)

I'll do the same for CSFML, but I think it's good as well to have the makefile creating the directory if necessary.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CSFML and _SYSTEM_ macros
« Reply #8 on: October 08, 2009, 09:15:12 am »
I fixed the makefiles (SFML, SFML-samples and CSFML), in both trunk and sfml2 branch.
I currently can't test on Linux, can you tell me if the fix is ok ? :)
Laurent Gomila - SFML developer

 

anything