-
Notifications
You must be signed in to change notification settings - Fork 262
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
Fixed #397: add C++ support #554
base: master
Are you sure you want to change the base?
Conversation
afaict, this is the same as the previous PR, which means none of the concerns have been addressed. please see the discussion in #397. |
@vapier hi, two questions:
thx! |
we should have a --enable-cxx option to configure.ac so people can control it would also be nice if we could link the code into libgd w/out requiring libstdc++, but i'm not sure how easy that'll be to pull off |
easy to implement. but could you please tell me the reason? although most libgd users do not need c++ wrapper, integrating libgd with c++ without any option sounds resonable considering the relation between c and c++. and reference to my question 2, we should include
we use iostream in |
@vapier , hi, i added thx |
sorry but I don't know what you mean by relation. libgd today does not require a C++ compiler or C++ runtime. that's good for embedded situations that don't have C++ compilers, and even on regular systems where we don't waste resources loading large and normally unused C++ runtimes. a common idiom in other projects seems to provide in an entirely sep lib like libgdxx.so or libgdcpp.so. that would hold all the C++ bits and not penalize everyone else. |
Hi, @vapier . So a better way to support C++ is to generate If so, is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a better way to support C++ is to generate
libgdcpp.so
when option--enable-cxx
is on?
correct!
If so, is
libgdcpp.so
the superset oflibgd.so
, orlibgdcpp.so
depends onlibgd.so
?
it would depend on libgd.so
@@ -10,6 +10,7 @@ SET(CMAKE_MODULE_PATH "${GD_SOURCE_DIR}/cmake/modules") | |||
include(gd) | |||
|
|||
OPTION(ENABLE_GD_FORMATS "Enable GD image formats" 0) | |||
OPTION(ENABLE_CXX "Enable CPP wrapper" 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"CPP wrapper" -> "C++ library"
@@ -113,6 +114,14 @@ fi | |||
AC_DEFINE_UNQUOTED([ENABLE_GD_FORMATS], [$gd_ac_value], [Whether to support gd image formats]) | |||
AM_CONDITIONAL([ENABLE_GD_FORMATS], test "$gd_enable_gd_formats" = yes) | |||
|
|||
AC_MSG_CHECKING([whether to support cpp wrapper]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "where to enable C++ interface library"
@@ -113,6 +114,14 @@ fi | |||
AC_DEFINE_UNQUOTED([ENABLE_GD_FORMATS], [$gd_ac_value], [Whether to support gd image formats]) | |||
AM_CONDITIONAL([ENABLE_GD_FORMATS], test "$gd_enable_gd_formats" = yes) | |||
|
|||
AC_MSG_CHECKING([whether to support cpp wrapper]) | |||
AC_ARG_ENABLE([cxx], | |||
[AS_HELP_STRING([--enable-cxx], [Enable cpp wrapper])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "Enable C++ interface library"
@@ -301,6 +310,7 @@ AC_MSG_RESULT([ | |||
** Configuration summary for $PACKAGE $VERSION: | |||
|
|||
Support for gd/gd2 images: $gd_enable_gd_formats | |||
Support for cpp wrapper: $gd_enable_cxx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"CPP wrapper" -> "C++ library"
I see this PR now. Please note I added the ENABLE_CPP option in CMake, so it makes perfect sense to have it in configure as well. I do agree as well on having a libgdcpp library, depending on libgd.so |
Are the changes done? |
original patch by Galik. Related PR #398