我有this绿洲文件和几个库 - 如何为每个库启用-w ..
和-warn-error +a
?
出于参考目的,给定的oasis文件如下所示:
OASISFormat: 0.4
Name: re
Version: 1.5.0
Synopsis: Pure OCaml regular expression library
Authors: Jerome Vouillon, Thomas Gazagnaire, Anil Madhavapeddy
License: LGPL-2.0 with OCaml linking exception
Plugins: META (0.4), DevFiles (0.4)
AlphaFeatures: compiled_setup_ml
BuildTools: ocamlbuild
Library re
Path: lib
InternalModules: Re_cset, Re_automata
Modules: Re
Findlibname: re
BuildDepends: bytes
Library re_emacs
Path: lib
XMETADescription: Emacs-compatible regexps
Modules: Re_emacs
Findlibname: emacs
FindlibParent: re
BuildDepends: re
答案 0 :(得分:5)
在_oasis
的顶层,添加
AlphaFeatures: ocamlbuild_more_args
XOCamlbuildExtraArgs: "-cflags 'flags'"
-cflags 'flags'
将传递给ocamlbuild
,flags
会将ocamlc
传递给-w +9+27+32 -warn-error +a
。在这种情况下,标志为import json
auth = []
with open("test.json",'rb') as authfile:
infile=authfile.readlines()
for line in infile:
auth_record = json.load(line)
auth.append(auth_record)