forked from freechipsproject/chisel-testers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CommonBuild.sc
31 lines (29 loc) · 873 Bytes
/
CommonBuild.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: Apache-2.0
def scalacOptionsVersion(scalaVersion: String): Seq[String] = {
Seq() ++ {
// If we're building with Scala > 2.11, enable the compile option
// switch to support our anonymous Bundle definitions:
// https://github.com/scala/bug/issues/10047
if (scalaVersion.startsWith("2.11.")) {
Seq()
} else {
Seq(
"-Xsource:2.11",
"-Ywarn-unused:imports",
"-Ywarn-unused:locals"
)
}
}
}
def javacOptionsVersion(scalaVersion: String): Seq[String] = {
Seq() ++ {
// Scala 2.12 requires Java 8. We continue to generate
// Java 7 compatible code for Scala 2.11
// for compatibility with old clients.
if (scalaVersion.startsWith("2.11.")) {
Seq("-source", "1.7", "-target", "1.7")
} else {
Seq("-source", "1.8", "-target", "1.8")
}
}
}