-a, --annotate Produce a colorized HTML version of the source.
--line-directives Produce #line directives pointing to the .pyx source
--cplus Output a c++ rather than c file.
- -X, --directive <name>=<value>[,<name=value,...] Overrides a compiler directive
+ --embed Embed the Python interpreter in a main() method.
+ --directive <name>=<value>[,<name=value,...] Overrides a compiler directive
"""
+
#The following experimental options are supported only on MacOSX:
# -C, --compile Compile generated .c file to .o file
# -X, --link Link .o file to produce extension module (implies -C)
elif option in ("-C", "--compile"):
options.c_only = 0
elif option in ("-X", "--link"):
+ if option == "-X":
+ print >>sys.stderr, "Deprecation warning: The -X command line switch will be changed to a"
+ print >>sys.stderr, "shorthand for --directive in Cython 0.12. Please use --link instead."
+ print >>sys.stderr
options.c_only = 0
options.obj_only = 0
elif option in ("-+", "--cplus"):
options.cplus = 1
+ elif option == "--embed":
+ Options.embed = True
elif option.startswith("-I"):
options.include_path.append(get_param(option))
elif option == "--include-dir":
options.emit_linenums = True
elif option in ("-X", "--directive"):
try:
- options.pragma_overrides = Options.parse_option_list(pop_arg())
+ options.compiler_directives = Options.parse_option_list(pop_arg())
except ValueError, e:
sys.stderr.write("Error in compiler directive: %s\n" % e.message)
sys.exit(1)
sys.exit(1)
if len(sources) == 0 and not options.show_version:
bad_usage()
+ if Options.embed and len(sources) > 1:
+ sys.stderr.write(
+ "cython: Only one source file allowed when using -embed\n")
+ sys.exit(1)
return options, sources