From 93da34a242f70f90991c0e850edd23d05bbb3ff6 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Thu, 16 May 2024 19:16:15 +0300 Subject: [PATCH] CXXRTLOptions: lazily evaluate pkg-config so it doesn't happen in the initialiser. --- .../scala/ee/hrzn/chryse/platform/cxxrtl/CXXRTLOptions.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/ee/hrzn/chryse/platform/cxxrtl/CXXRTLOptions.scala b/src/main/scala/ee/hrzn/chryse/platform/cxxrtl/CXXRTLOptions.scala index 75ad529..4e55d0a 100644 --- a/src/main/scala/ee/hrzn/chryse/platform/cxxrtl/CXXRTLOptions.scala +++ b/src/main/scala/ee/hrzn/chryse/platform/cxxrtl/CXXRTLOptions.scala @@ -11,10 +11,10 @@ final case class CXXRTLOptions( ldFlags: Seq[String] = Seq(), pkgConfig: Seq[String] = Seq(), ) { - val allCxxFlags: Seq[String] = cxxFlags ++ pkgConfig.flatMap( + lazy val allCxxFlags: Seq[String] = cxxFlags ++ pkgConfig.flatMap( Seq("pkg-config", "--cflags", _).!!.trim.split(' '), ) - val allLdFlags: Seq[String] = ldFlags ++ pkgConfig.flatMap( + lazy val allLdFlags: Seq[String] = ldFlags ++ pkgConfig.flatMap( Seq("pkg-config", "--libs", _).!!.trim.split(' '), ) }