Skip to content

Commit 3ca8ee0

Browse files
committed
fascinating
1 parent d9f7514 commit 3ca8ee0

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

build.sbt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,27 @@ val catsEffectVersion = "3.3.14"
3838
val http4sVersion = "0.23.16"
3939
val munitCEVersion = "2.0.0-M3"
4040

41+
val vcpkgBaseDir = "C:/vcpkg/"
42+
4143
ThisBuild / nativeConfig ~= { c =>
4244
val osNameOpt = sys.props.get("os.name")
4345
val isMacOs = osNameOpt.exists(_.toLowerCase().contains("mac"))
4446
val isWindows = osNameOpt.exists(_.toLowerCase().contains("windows"))
4547
if (isMacOs) { // brew-installed curl
4648
c.withLinkingOptions(c.linkingOptions :+ "-L/usr/local/opt/curl/lib")
4749
} else if (isWindows) { // vcpkg-installed curl
48-
val vcpkgBaseDir = "C:/vcpkg/"
4950
c.withCompileOptions(c.compileOptions :+ s"-I${vcpkgBaseDir}/installed/x64-windows/include/")
5051
.withLinkingOptions(c.linkingOptions :+ s"-L${vcpkgBaseDir}/installed/x64-windows/lib/")
5152
} else c
5253
}
5354

54-
// These shared settings are used specifically for Windows, where we need to put in the PATH the directory containing the shared libraries
55-
lazy val sharedSettings = Seq(
56-
Compile / envVars := {
57-
if (sys.props.get("os.name").exists(_.toLowerCase().contains("windows")) == false) Map()
58-
else
59-
Map(
60-
"PATH" -> s"${sys.props.getOrElse("PATH", "")};${vcpkgBaseDir}/installed/x64-windows/bin/"
61-
)
62-
}
63-
)
55+
ThisBuild / envVars ++= {
56+
if (sys.props.get("os.name").exists(_.toLowerCase().contains("windows")))
57+
Map(
58+
"PATH" -> s"${sys.props.getOrElse("PATH", "")};${vcpkgBaseDir}/installed/x64-windows/bin/"
59+
)
60+
else Map.empty[String, String]
61+
}
6462

6563
lazy val root = project.in(file(".")).enablePlugins(NoPublishPlugin).aggregate(curl, example)
6664

@@ -75,7 +73,6 @@ lazy val curl = project
7573
"org.typelevel" %%% "munit-cats-effect" % munitCEVersion % Test,
7674
),
7775
)
78-
.settings(sharedSettings)
7976

8077
lazy val example = project
8178
.in(file("example"))
@@ -86,4 +83,3 @@ lazy val example = project
8683
"org.http4s" %%% "http4s-circe" % http4sVersion
8784
)
8885
)
89-
.settings(sharedSettings)

0 commit comments

Comments
 (0)