felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=80449ef83e29e1ccf83fa95e5a6d4781c169cea1

commit 80449ef83e29e1ccf83fa95e5a6d4781c169cea1
Author: Felipe Magno de Almeida <[email protected]>
Date:   Thu Feb 9 21:24:33 2017 -0200

    elementary-cxx: Make C++ test compile a not used archive so linking can be 
avoided
    
    Fixes linking errors for some older combos of C++ compiler and linker.
    
    T2838
---
 src/Makefile_Cxx.am                                | 23 +++++++++++++++-------
 src/tests/elementary_cxx/cxx_compile_test.cc       |  4 ----
 src/tests/elementary_cxx/cxx_dummy_compile_test.cc |  5 +++++
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/Makefile_Cxx.am b/src/Makefile_Cxx.am
index 16317c8..f564d4f 100644
--- a/src/Makefile_Cxx.am
+++ b/src/Makefile_Cxx.am
@@ -348,20 +348,29 @@ tests_evas_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ 
@USE_EVAS_LIBS@
 tests_evas_cxx_cxx_compile_test_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@
 
 ### Tests for Elementary
-check_PROGRAMS += tests/elementary_cxx/cxx_compile_test
-TESTS += tests/elementary_cxx/cxx_compile_test
+check_PROGRAMS += tests/elementary_cxx/cxx_dummy_compile_test
+TESTS += tests/elementary_cxx/cxx_dummy_compile_test
 
-tests_elementary_cxx_cxx_compile_test_SOURCES = 
tests/elementary_cxx/cxx_compile_test.cc
-tests_elementary_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl 
\
+check_LIBRARIES = tests/elementary_cxx/libcxx_compile_test.a
+tests_elementary_cxx_libcxx_compile_test_a_SOURCES = 
tests/elementary_cxx/cxx_compile_test.cc
+tests_elementary_cxx_libcxx_compile_test_a_CPPFLAGS = 
-I$(top_builddir)/src/lib/efl \
+-I$(top_builddir)/src/lib/evas/canvas/ \
+-I$(top_builddir)/src/lib/efl/interfaces/ \
+-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/elementary_cxx\" \
+-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/elementary_cxx\" \
+@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ 
@ELEMENTARY_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \
+@ECORE_CFLAGS@ @EINA_CFLAGS@ @EVAS_CFLAGS@ @ELEMENTARY_CFLAGS@ @EO_CFLAGS@
+
+tests/elementary_cxx/tests_elementary_cxx_cxx_dummy_compile_test-cxx_dummy_compile_test.$(OBJEXT):
 tests/elementary_cxx/libcxx_compile_test.a
+
+tests_elementary_cxx_cxx_dummy_compile_test_SOURCES = 
tests/elementary_cxx/cxx_dummy_compile_test.cc
+tests_elementary_cxx_cxx_dummy_compile_test_CPPFLAGS = 
-I$(top_builddir)/src/lib/efl \
 -I$(top_builddir)/src/lib/evas/canvas/ \
 -I$(top_builddir)/src/lib/efl/interfaces/ \
 -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/elementary_cxx\" \
 -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/elementary_cxx\" \
 @CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ 
@ELEMENTARY_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \
 @ECORE_CFLAGS@ @EINA_CFLAGS@ @EVAS_CFLAGS@ @ELEMENTARY_CFLAGS@ @EO_CFLAGS@
-# No function is called, so we don't need to link to elementary
-tests_elementary_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@
-tests_elementary_cxx_cxx_compile_test_DEPENDENCIES = 
 
 endif
 
diff --git a/src/tests/elementary_cxx/cxx_compile_test.cc 
b/src/tests/elementary_cxx/cxx_compile_test.cc
index 0ff0f2a..62b9460 100644
--- a/src/tests/elementary_cxx/cxx_compile_test.cc
+++ b/src/tests/elementary_cxx/cxx_compile_test.cc
@@ -8,7 +8,3 @@
 
 #include <iostream>
 
-int main()
-{
-   return 0;
-}
diff --git a/src/tests/elementary_cxx/cxx_dummy_compile_test.cc 
b/src/tests/elementary_cxx/cxx_dummy_compile_test.cc
new file mode 100644
index 0000000..a25e629
--- /dev/null
+++ b/src/tests/elementary_cxx/cxx_dummy_compile_test.cc
@@ -0,0 +1,5 @@
+
+int main()
+{
+   return 0;
+}

-- 


Reply via email to