@@ -38,29 +38,27 @@ val catsEffectVersion = "3.3.14"
38
38
val http4sVersion = " 0.23.16"
39
39
val munitCEVersion = " 2.0.0-M3"
40
40
41
+ val vcpkgBaseDir = " C:/vcpkg/"
42
+
41
43
ThisBuild / nativeConfig ~= { c =>
42
44
val osNameOpt = sys.props.get(" os.name" )
43
45
val isMacOs = osNameOpt.exists(_.toLowerCase().contains(" mac" ))
44
46
val isWindows = osNameOpt.exists(_.toLowerCase().contains(" windows" ))
45
47
if (isMacOs) { // brew-installed curl
46
48
c.withLinkingOptions(c.linkingOptions :+ " -L/usr/local/opt/curl/lib" )
47
49
} else if (isWindows) { // vcpkg-installed curl
48
- val vcpkgBaseDir = " C:/vcpkg/"
49
50
c.withCompileOptions(c.compileOptions :+ s " -I ${vcpkgBaseDir}/installed/x64-windows/include/ " )
50
51
.withLinkingOptions(c.linkingOptions :+ s " -L ${vcpkgBaseDir}/installed/x64-windows/lib/ " )
51
52
} else c
52
53
}
53
54
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
+ }
64
62
65
63
lazy val root = project.in(file(" ." )).enablePlugins(NoPublishPlugin ).aggregate(curl, example)
66
64
@@ -75,7 +73,6 @@ lazy val curl = project
75
73
" org.typelevel" %%% " munit-cats-effect" % munitCEVersion % Test ,
76
74
),
77
75
)
78
- .settings(sharedSettings)
79
76
80
77
lazy val example = project
81
78
.in(file(" example" ))
@@ -86,4 +83,3 @@ lazy val example = project
86
83
" org.http4s" %%% " http4s-circe" % http4sVersion
87
84
)
88
85
)
89
- .settings(sharedSettings)
0 commit comments