forked from enlightenment/efl
eolian_cxx: fix install-examples and (post-install) compilation.
Summary: This patch fixes T1226 by adding a Makefile.examples to examples/eolian_cxx. It also fixes a bug in bin/eolian_cxx: the include paths were not being correctly generated for directories outside EFL tree. Reviewers: cedric, smohanty, stefan_schmidt, stefan CC: uartie, wayland-efl, felipealmeida, raster, woohyun, cedric Maniphest Tasks: T1226 Differential Revision: https://phab.enlightenment.org/D824 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
This commit is contained in:
parent
f6cf7cf35e
commit
95f5c11703
|
@ -1121,8 +1121,8 @@ EFL_LIB_START([Eolian_Cxx])
|
||||||
## Compatibility layers
|
## Compatibility layers
|
||||||
|
|
||||||
### Checks for libraries
|
### Checks for libraries
|
||||||
EFL_INTERNAL_DEPEND_PKG([EOLIAN], [eina])
|
EFL_INTERNAL_DEPEND_PKG([EOLIAN_CXX], [eina])
|
||||||
EFL_INTERNAL_DEPEND_PKG([EOLIAN], [eo])
|
EFL_INTERNAL_DEPEND_PKG([EOLIAN_CXX], [eo])
|
||||||
|
|
||||||
### Checks for header files
|
### Checks for header files
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,10 @@ _resolve_includes(std::string const& classname)
|
||||||
std::string filename, namespace_;
|
std::string filename, namespace_;
|
||||||
std::tie(filename, namespace_) = get_filename_info(eo_parent_file);
|
std::tie(filename, namespace_) = get_filename_info(eo_parent_file);
|
||||||
// we have our own eo_base.hh
|
// we have our own eo_base.hh
|
||||||
if (filename != "eo_base.eo" || namespace_ != "eo")
|
std::string eo_base_eo = "eo_base.eo";
|
||||||
|
if (filename.length() < eo_base_eo.length() ||
|
||||||
|
!std::equal(eo_base_eo.begin(), eo_base_eo.end(),
|
||||||
|
filename.end() - eo_base_eo.length()))
|
||||||
{
|
{
|
||||||
gen_opts.cxx_headers.push_back(filename + ".hh");
|
gen_opts.cxx_headers.push_back(filename + ".hh");
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@ AUTOMAKE_OPTIONS = subdir-objects
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
AM_CXXFLAGS = \
|
AM_CXXFLAGS = \
|
||||||
-I. \
|
-I$(srcdir) \
|
||||||
|
-I$(builddir) \
|
||||||
-I$(top_builddir)/src/lib/efl \
|
-I$(top_builddir)/src/lib/efl \
|
||||||
-I$(top_srcdir)/src/lib/eina \
|
-I$(top_srcdir)/src/lib/eina \
|
||||||
-I$(top_builddir)/src/lib/eina \
|
-I$(top_builddir)/src/lib/eina \
|
||||||
|
@ -34,7 +35,7 @@ AM_LDFLAGS = \
|
||||||
-L$(top_builddir)/src/lib/evas \
|
-L$(top_builddir)/src/lib/evas \
|
||||||
-L$(top_builddir)/src/lib/ecore \
|
-L$(top_builddir)/src/lib/ecore \
|
||||||
-L$(top_builddir)/src/lib/ecore_evas \
|
-L$(top_builddir)/src/lib/ecore_evas \
|
||||||
-leina -levas -leo -lecore -lecore_evas
|
-leina -levas -leo -lecore -lecore_evas -pthread
|
||||||
|
|
||||||
LDADD = \
|
LDADD = \
|
||||||
$(top_builddir)/src/lib/eo/libeo.la \
|
$(top_builddir)/src/lib/eo/libeo.la \
|
||||||
|
@ -54,25 +55,27 @@ EOS = \
|
||||||
colourable.eo \
|
colourable.eo \
|
||||||
colourablesquare.eo
|
colourablesquare.eo
|
||||||
|
|
||||||
|
IMPL = \
|
||||||
|
colourable.c \
|
||||||
|
colourablesquare.c
|
||||||
|
|
||||||
SRCS = \
|
SRCS = \
|
||||||
eolian_cxx_simple_01.cc \
|
eolian_cxx_simple_01.cc \
|
||||||
eolian_cxx_inherit_01.cc
|
eolian_cxx_inherit_01.cc \
|
||||||
|
$(IMPL)
|
||||||
|
|
||||||
EXTRA_PROGRAMS = \
|
EXTRA_PROGRAMS = \
|
||||||
eolian_cxx_simple_01 \
|
eolian_cxx_simple_01 \
|
||||||
eolian_cxx_inherit_01
|
eolian_cxx_inherit_01
|
||||||
|
|
||||||
|
DATA_FILES = Makefile.examples $(EOS)
|
||||||
CLEANFILES =
|
CLEANFILES =
|
||||||
|
|
||||||
eolian_cxx_simple_01_SOURCES = \
|
eolian_cxx_simple_01_SOURCES = eolian_cxx_simple_01.cc $(IMPL)
|
||||||
eolian_cxx_simple_01.cc \
|
eolian_cxx_simple_01_DEPENDENCIES = $(GENERATED)
|
||||||
colourable.c \
|
|
||||||
colourablesquare.c
|
|
||||||
|
|
||||||
eolian_cxx_inherit_01_SOURCES = \
|
eolian_cxx_inherit_01_SOURCES = eolian_cxx_inherit_01.cc $(IMPL)
|
||||||
eolian_cxx_inherit_01.cc \
|
eolian_cxx_inherit_01_DEPENDENCIES = $(GENERATED)
|
||||||
colourable.c \
|
|
||||||
colourablesquare.c
|
|
||||||
|
|
||||||
EOLIAN_GEN = $(top_builddir)/src/bin/eolian/eolian_gen${EXEEXT}
|
EOLIAN_GEN = $(top_builddir)/src/bin/eolian/eolian_gen${EXEEXT}
|
||||||
EOLIAN_CXX = $(top_builddir)/src/bin/eolian_cxx/eolian_cxx${EXEEXT}
|
EOLIAN_CXX = $(top_builddir)/src/bin/eolian_cxx/eolian_cxx${EXEEXT}
|
||||||
|
@ -86,7 +89,7 @@ EOLIAN_FLAGS = \
|
||||||
SUFFIXES = .eo .eo.c .eo.h .eo.hh
|
SUFFIXES = .eo .eo.c .eo.h .eo.hh
|
||||||
|
|
||||||
%.eo.hh: %.eo $(EOLIAN_CXX)
|
%.eo.hh: %.eo $(EOLIAN_CXX)
|
||||||
$(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I$< -o $@
|
$(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./$< -o $@
|
||||||
|
|
||||||
%.eo.c: %.eo $(EOLIAN_GEN)
|
%.eo.c: %.eo $(EOLIAN_GEN)
|
||||||
$(AM_V_EOL)$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o $@ $<
|
$(AM_V_EOL)$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o $@ $<
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
|
||||||
|
CXX=g++
|
||||||
|
CC=gcc
|
||||||
|
EOLIAN_GEN=eolian_gen
|
||||||
|
EOLIAN_CXX=eolian_cxx
|
||||||
|
COMMON_FLAGS=`pkg-config --libs --cflags eina,ecore,evas,ecore-evas,emotion,eolian,eolian-cxx,eo-cxx,eina-cxx` -DEFL_BETA_API_SUPPORT
|
||||||
|
EOLIAN_FLAGS=`pkg-config --variable=eolian_flags eo` -I.
|
||||||
|
|
||||||
|
EOS = colourable.eo colourablesquare.eo
|
||||||
|
|
||||||
|
IMPL = colourable.c colourablesquare.c
|
||||||
|
|
||||||
|
GENERATED = \
|
||||||
|
colourable.eo.c \
|
||||||
|
colourable.eo.h \
|
||||||
|
colourable.eo.hh \
|
||||||
|
colourablesquare.eo.c \
|
||||||
|
colourablesquare.eo.h \
|
||||||
|
colourablesquare.eo.hh
|
||||||
|
|
||||||
|
EXAMPLES= eolian_cxx_inherit_01 \
|
||||||
|
eolian_cxx_simple_01
|
||||||
|
|
||||||
|
OBJS = colourable.o colourablesquare.o
|
||||||
|
|
||||||
|
all: $(OBJS) examples
|
||||||
|
|
||||||
|
codegen:
|
||||||
|
$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./colourable.eo -o colourable.eo.hh
|
||||||
|
$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./colourablesquare.eo -o colourablesquare.eo.hh
|
||||||
|
$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o colourable.eo.c colourable.eo
|
||||||
|
$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o colourablesquare.eo.c colourablesquare.eo
|
||||||
|
$(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o colourable.eo.h colourable.eo
|
||||||
|
$(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o colourablesquare.eo.h colourablesquare.eo
|
||||||
|
|
||||||
|
$(OBJS): codegen
|
||||||
|
$(CC) -c colourable.c $(COMMON_FLAGS)
|
||||||
|
$(CC) -c colourablesquare.c $(COMMON_FLAGS)
|
||||||
|
|
||||||
|
examples: $(EXAMPLES)
|
||||||
|
|
||||||
|
$(EXAMPLES):
|
||||||
|
$(CXX) -o $@ $@.cc $(OBJS) $(COMMON_FLAGS) -std=c++11
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo "Cleaning up built objects..."
|
||||||
|
@rm -Rf $(EXAMPLES)
|
Loading…
Reference in New Issue