modules = [Extension("MyLibrary",
src,
language = "c++",
extra_compile_args=["-fopenmp", "-std=c++11", "-DNOLOG4CXX"], # log4cxx is not currently used
extra_link_args=["-fopenmp", "-std=c++11"],
include_dirs=[os.path.join(os.path.expanduser("~"), (os.path.join(gtest, "include"))],
library_dirs=[log4cxx_library, os.path.join(os.path.expanduser("~"), gtest)],
libraries=["log4cxx", "gtest"])]
这是我的 setup.py 脚本的一部分。如何通过命令行参数传递 include_dirs 或 library_dirs 等选项,以便用户可以设置该路径?
最佳答案
认为这可能是您正在寻找的:
关于python - 将库路径作为命令行参数传递给 setup.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16984753/