Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 7549615

Browse files
author
Saul Beniquez
committed
Adding conditional automake directives to allow Win32 compilation on win32-mingw/cygwin-mingw systems.
1 parent 53598bd commit 7549615

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ACLOCAL_AMFLAGS = -I m4
22
EXTRA_DIST = docs
3-
SUBDIRS = UnitTest++
3+
4+
include UnitTest++/Makefile.am
5+
include tests/Makefile.am

UnitTest++/Makefile.am

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
lib_LTLIBRARIES = libUnitTest++.la
2-
pkgincludedir = $(includedir)/UnitTest++
3-
nobase_pkginclude_HEADERS = UnitTest++.h UnitTestPP.h Config.h HelperMacros.h Test.h TestDetails.h TestList.h TestSuite.h TestResults.h TestMacros.h CheckMacros.h TestRunner.h TimeConstraint.h ExecuteTest.h AssertException.h MemoryOutStream.h CurrentTest.h Posix/SignalTranslator.h Checks.h TimeHelpers.h Posix/TimeHelpers.h ExceptionMacros.h ReportAssert.h ReportAssertImpl.h TestReporter.h TestReporterStdout.h CompositeTestReporter.h DeferredTestReporter.h DeferredTestResult.h
4-
libUnitTest___la_SOURCES = AssertException.cpp Test.cpp Checks.cpp TestRunner.cpp TestResults.cpp TestReporter.cpp TestReporterStdout.cpp ReportAssert.cpp TestList.cpp TimeConstraint.cpp TestDetails.cpp MemoryOutStream.cpp DeferredTestReporter.cpp DeferredTestResult.cpp XmlTestReporter.cpp CurrentTest.cpp Posix/SignalTranslator.cpp Posix/TimeHelpers.cpp CompositeTestReporter.cpp
5-
libUnitTest___la_LDFLAGS = -version-number @LIBUNITTEST_SO_VERSION@
6-
check_PROGRAMS = TestUnitTest++
7-
TestUnitTest___SOURCES = $(top_srcdir)/tests/Main.cpp $(top_srcdir)/tests/TestAssertHandler.cpp $(top_srcdir)/tests/TestCheckMacros.cpp $(top_srcdir)/tests/TestChecks.cpp $(top_srcdir)/tests/TestCompositeTestReporter.cpp $(top_srcdir)/tests/TestCurrentTest.cpp $(top_srcdir)/tests/TestDeferredTestReporter.cpp $(top_srcdir)/tests/TestExceptions.cpp $(top_srcdir)/tests/TestMemoryOutStream.cpp $(top_srcdir)/tests/TestTest.cpp $(top_srcdir)/tests/TestTestList.cpp $(top_srcdir)/tests/TestTestMacros.cpp $(top_srcdir)/tests/TestTestResults.cpp $(top_srcdir)/tests/TestTestRunner.cpp $(top_srcdir)/tests/TestTestSuite.cpp $(top_srcdir)/tests/TestTimeConstraint.cpp $(top_srcdir)/tests/TestTimeConstraintMacro.cpp $(top_srcdir)/tests/TestUnitTestPP.cpp $(top_srcdir)/tests/TestXmlTestReporter.cpp
8-
TestUnitTest___LDADD = libUnitTest++.la
9-
TESTS = TestUnitTest++
1+
lib_LTLIBRARIES = UnitTest++/libUnitTest++.la
2+
pkgincludedir = $(includedir)/UnitTest++/
3+
nobase_pkginclude_HEADERS = UnitTest++/UnitTest++.h UnitTest++/UnitTestPP.h UnitTest++/Config.h UnitTest++/HelperMacros.h UnitTest++/Test.h UnitTest++/TestDetails.h UnitTest++/TestList.h UnitTest++/TestSuite.h UnitTest++/TestResults.h UnitTest++/TestMacros.h UnitTest++/CheckMacros.h UnitTest++/TestRunner.h UnitTest++/TimeConstraint.h UnitTest++/ExecuteTest.h UnitTest++/AssertException.h UnitTest++/MemoryOutStream.h UnitTest++/CurrentTest.h UnitTest++/Checks.h UnitTest++/TimeHelpers.h UnitTest++/ExceptionMacros.h UnitTest++/ReportAssert.h UnitTest++/ReportAssertImpl.h UnitTest++/TestReporter.h UnitTest++/TestReporterStdout.h UnitTest++/CompositeTestReporter.h UnitTest++/DeferredTestReporter.h UnitTest++/DeferredTestResult.h
4+
UnitTest___libUnitTest___la_SOURCES = UnitTest++/AssertException.cpp UnitTest++/Test.cpp UnitTest++/Checks.cpp UnitTest++/TestRunner.cpp UnitTest++/TestResults.cpp UnitTest++/TestReporter.cpp UnitTest++/TestReporterStdout.cpp UnitTest++/ReportAssert.cpp UnitTest++/TestList.cpp UnitTest++/TimeConstraint.cpp UnitTest++/TestDetails.cpp UnitTest++/MemoryOutStream.cpp UnitTest++/DeferredTestReporter.cpp UnitTest++/DeferredTestResult.cpp UnitTest++/XmlTestReporter.cpp UnitTest++/CurrentTest.cpp UnitTest++/CompositeTestReporter.cpp
5+
UnitTest___libUnitTest___la_CPPFLAGS =
6+
7+
if WINDOWS
8+
nobase_pkginclude_HEADERS += UnitTest++/Win32/TimeHelpers.h
9+
UnitTest___libUnitTest___la_SOURCES += UnitTest++/Win32/TimeHelpers.cpp
10+
else
11+
nobase_pkginclude_HEADERS += UnitTest++/Posix/SignalTranslator.h UnitTest++/Posix/TimeHelpers.h
12+
UnitTest___libUnitTest___la_SOURCES += UnitTest++/Posix/SignalTranslator.cpp UnitTest++/Posix/TimeHelpers.cpp
13+
UnitTest___libUnitTest___la_CPPFLAGS += -DUNITTEST_POSIX
14+
endif
15+
16+
UnitTest___libUnitTest___la_LDFLAGS = -version-number @LIBUNITTEST_SO_VERSION@
17+
18+

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ AC_CONFIG_SRCDIR([UnitTest++/TestDetails.cpp])
77
AC_CONFIG_MACRO_DIR([m4])
88
AC_CONFIG_HEADERS([config.h])
99

10-
AM_INIT_AUTOMAKE([foreign])
10+
AM_INIT_AUTOMAKE([foreign subdir-objects])
11+
AM_CONDITIONAL([WINDOWS], [test "$OS" == "Windows_NT"])
1112
LT_INIT()
1213

1314
AC_SUBST([LIBUNITTEST_SO_VERSION], [1:4:1])
@@ -29,6 +30,5 @@ AC_TYPE_SIZE_T
2930
# Checks for library functions.
3031
AC_CHECK_FUNCS([gettimeofday strstr])
3132

32-
AC_CONFIG_FILES([Makefile
33-
UnitTest++/Makefile])
33+
AC_CONFIG_FILES([Makefile])
3434
AC_OUTPUT

tests/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
check_PROGRAMS = UnitTest++/TestUnitTest++
2+
UnitTest___TestUnitTest___SOURCES = tests/Main.cpp tests/TestAssertHandler.cpp tests/TestCheckMacros.cpp tests/TestChecks.cpp tests/TestCompositeTestReporter.cpp tests/TestCurrentTest.cpp tests/TestDeferredTestReporter.cpp tests/TestExceptions.cpp tests/TestMemoryOutStream.cpp tests/TestTest.cpp tests/TestTestList.cpp tests/TestTestMacros.cpp tests/TestTestResults.cpp tests/TestTestRunner.cpp tests/TestTestSuite.cpp tests/TestTimeConstraint.cpp tests/TestTimeConstraintMacro.cpp tests/TestUnitTestPP.cpp tests/TestXmlTestReporter.cpp
3+
UnitTest___TestUnitTest___LDADD = UnitTest++/libUnitTest++.la
4+
TESTS = UnitTest++/TestUnitTest++

0 commit comments

Comments
 (0)