CEGUI Default Branch Standard = C++11 or gnu++11 ?

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

iceiceice
Not too shy to talk
Not too shy to talk
Posts: 33
Joined: Thu Jul 09, 2015 10:20

CEGUI Default Branch Standard = C++11 or gnu++11 ?

Postby iceiceice » Wed Oct 14, 2015 15:31

In the Default branch cmake script for CEGUI, the C++11 standard is selected in this block of code

Code: Select all

if ((CMAKE_C_COMPILER_ID STREQUAL "GNU") OR (CMAKE_C_COMPILER_ID STREQUAL "Clang"))
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
elseif (NOT CMAKE_VERSION VERSION_LESS "3.1")
    set (CMAKE_C_STANDARD_REQUIRED TRUE)
    set (CMAKE_C_STANDARD "11")
endif ()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
elseif (NOT CMAKE_VERSION VERSION_LESS "3.1")
    set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
    set (CMAKE_CXX_STANDARD "11")
endif ()


This makes it so that if CEGUI is compiled with gcc or clang, the gcc-specific compiler extensions will be enabled.
Some projects would prefer not to enable these extensions, because, some of them conflict with the official standard, and others,
might not be supported by other compilers. If people want to statically link CEGUI into their project and it only compiles with
these extensions, though, then they might be forced to change compilers to something that supports these extensions.

Does CEGUI actually use these extensions?
If not, can I request or suggest that we make it `std=c++11` instead of `gnu++11 ` above?

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: CEGUI Default Branch Standard = C++11 or gnu++11 ?

Postby YaronCT » Wed Oct 14, 2015 15:47

I agree that as long as we don't need GCC's extensions we might as well go with "-std=c++11" for C++ and "-std=c11" for C.

timotei
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Apr 29, 2013 14:17

Re: CEGUI Default Branch Standard = C++11 or gnu++11 ?

Postby timotei » Wed Oct 14, 2015 18:01

+1 On using standard C++11. I don't see why we'd use GNU++11, since we aim at being cross-platfom

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: CEGUI Default Branch Standard = C++11 or gnu++11 ?

Postby YaronCT » Sun Oct 25, 2015 07:15

Well, if there's no objection, I'll make the change. I'll also make branches "v0-8" and "v0" explicitly use the C++03/C99 standard. I'm not sure it's necessary, but it wouldn't hurt.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: CEGUI Default Branch Standard = C++11 or gnu++11 ?

Postby Ident » Sun Nov 01, 2015 19:21

It got merged.
CrazyEddie: "I don't like GUIs"


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 15 guests