make/common/JavaCompilation.gmk
changeset 42140 a2ea75dd99dc
parent 41458 f285e333e8db
child 47217 72e3ae9a25eb
--- a/make/common/JavaCompilation.gmk	Wed Nov 23 19:14:43 2016 +0000
+++ b/make/common/JavaCompilation.gmk	Thu Nov 24 11:50:26 2016 +0100
@@ -172,6 +172,7 @@
 #   KEEP_DUPS:=Do not remove duplicate file names from different source roots.
 #   FAIL_NO_SRC:=Set to false to not fail the build if no source files are found,
 #        default is true.
+#   DEBUG_SYMBOLS:=Set to false to disable generation of debug symbols.
 SetupJavaCompilation = $(NamedParamsMacroTemplate)
 define SetupJavaCompilationBody
 
@@ -183,7 +184,11 @@
   # Extract the info from the java compiler setup.
   $1_JVM := $$($$($1_SETUP)_JVM)
   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
-  $1_FLAGS := $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS)
+  $1_FLAGS :=
+  ifneq ($$($1_DEBUG_SYMBOLS), false)
+    $1_FLAGS := -g
+  endif
+  $1_FLAGS += $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS)
   ifneq ($$($1_CLASSPATH), )
     $1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
   endif