Skip to content

Commit 280ba43

Browse files
committed
Cleanups
* Move headers to include * Auto detect c++17 support
1 parent af31177 commit 280ba43

File tree

5 files changed

+957
-2
lines changed

5 files changed

+957
-2
lines changed

Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
SUBDIRS=lib
22

3+
include_HEADERS = include/practical-sa.h
4+
35
ut:
46
$(MAKE) -C lib ut
57

configure.ac

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ AC_CONFIG_HEADERS([config.h])
77
AM_INIT_AUTOMAKE([foreign subdir-objects])
88
LT_INIT
99

10+
m4_include([m4/ax_cxx_compile_stdcxx.m4])
11+
1012
AC_LANG(C++)
1113
# Checks for programs.
1214
AC_PROG_CXX
@@ -23,9 +25,11 @@ PKG_PROG_PKG_CONFIG
2325
PKG_CHECK_MODULES([CPPUNIT], [cppunit], , [AC_MSG_FAILURE([CppUnit module not found])])
2426

2527
# Checks for header files.
28+
AC_SUBST([AM_CPPFLAGS], [-I\$\(top_srcdir\)/include])
2629

2730
# Checks for typedefs, structures, and compiler characteristics.
2831
AC_TYPE_SIZE_T
32+
AX_CXX_COMPILE_STDCXX(17, [noext], [mandatory])
2933

3034
# Checks for library functions.
3135

File renamed without changes.

lib/Makefile.am

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ noinst_PROGRAMS = practical-sa-ut practiparse
33

44
libpractical_sa_la_LDFLAGS = -version-info 0:0:0
55
libpractical_sa_la_SOURCES = tokenizer.cpp parser.cpp scope_tracing.cpp semantic_analyzer.cpp
6-
include_HEADERS = practical-sa.h
76

87
practical_sa_ut_SOURCES = ut_runner.cpp slice_ut.cpp tokenizer_ut.cpp tokenizer.cpp
9-
practical_sa_ut_CPPFLAGS = -I. # Otherwise we can't use the same CPP files for both library and UT
8+
# We need automake to compile cpp files for the UTs distinctly than for the library. We do this by adding a useless compile flag
9+
# that applies only to the UTs executable. Otherwise we can't use the same CPP files for both library and UT
10+
practical_sa_ut_CPPFLAGS = -I.
1011
practical_sa_ut_LDADD = @CPPUNIT_LIBS@
1112
practical_sa_ut_CFLAGS = @CPPUNIT_CFLAGS@ $(AM_CFLAGS)
1213

0 commit comments

Comments
 (0)