@@ -25,6 +25,8 @@ case class NativeConfigOptions(
2525 ltp : List [String ] = List .empty,
2626 linkingOption : List [String ] = List .empty,
2727 compileOption : List [String ] = List .empty,
28+ cCompileOptions : List [String ] = List .empty,
29+ cppCompileOptions : List [String ] = List .empty,
2830 targetTriple : Option [String ] = None ,
2931 clang : Option [String ] = None ,
3032 clangPP : Option [String ] = None ,
@@ -227,12 +229,43 @@ object NativeConfigOptions {
227229 .valueName(" <passed-option>" )
228230 .optional()
229231 .unbounded()
230- .action((x , c) =>
232+ .action((value , c) =>
231233 c.copy(nativeConfig =
232- c.nativeConfig.copy(compileOption = c.nativeConfig.compileOption :+ x)
234+ c.nativeConfig
235+ .copy(cCompileOptions = c.nativeConfig.cCompileOptions :+ value)
233236 )
234237 )
235238 .text(" Compilation options passed to LLVM. Multiple can be defined." )
239+ parser
240+ .opt[String ](" c-compile-option" )
241+ .valueName(" <option>" )
242+ .optional()
243+ .unbounded()
244+ .abbr(" -copt" )
245+ .text(
246+ " Compilation options used when compiling C files only. Multiple can be defined."
247+ )
248+ .action((value, c) =>
249+ c.copy(nativeConfig =
250+ c.nativeConfig
251+ .copy(cCompileOptions = c.nativeConfig.cCompileOptions :+ value)
252+ )
253+ )
254+ parser
255+ .opt[String ](" cpp-compile-option" )
256+ .valueName(" <option>" )
257+ .optional()
258+ .unbounded()
259+ .abbr(" -cppopt" )
260+ .text(
261+ " Compilation options used when compiling C++ files only. Multiple can be defined."
262+ )
263+ .action((value, c) =>
264+ c.copy(nativeConfig =
265+ c.nativeConfig
266+ .copy(cCompileOptions = c.nativeConfig.cppCompileOptions :+ value)
267+ )
268+ )
236269 parser
237270 .opt[String ](" target-triple" )
238271 .valueName(" <config-string>" )
0 commit comments