Define the executables (and options for them) that will be run to perform the various stages of compilation. The exact set of executables that may be specified here depends on the compiler class (via the 'executables' class attribute), but most will have: compiler
(self, **kwargs)
| 116 | self.set_executable(key, self.executables[key]) |
| 117 | |
| 118 | def set_executables(self, **kwargs): |
| 119 | """Define the executables (and options for them) that will be run |
| 120 | to perform the various stages of compilation. The exact set of |
| 121 | executables that may be specified here depends on the compiler |
| 122 | class (via the 'executables' class attribute), but most will have: |
| 123 | compiler the C/C++ compiler |
| 124 | linker_so linker used to create shared objects and libraries |
| 125 | linker_exe linker used to create binary executables |
| 126 | archiver static library creator |
| 127 | |
| 128 | On platforms with a command-line (Unix, DOS/Windows), each of these |
| 129 | is a string that will be split into executable name and (optional) |
| 130 | list of arguments. (Splitting the string is done similarly to how |
| 131 | Unix shells operate: words are delimited by spaces, but quotes and |
| 132 | backslashes can override this. See |
| 133 | 'distutils.util.split_quoted()'.) |
| 134 | """ |
| 135 | |
| 136 | # Note that some CCompiler implementation classes will define class |
| 137 | # attributes 'cpp', 'cc', etc. with hard-coded executable names; |
| 138 | # this is appropriate when a compiler class is for exactly one |
| 139 | # compiler/OS combination (eg. MSVCCompiler). Other compiler |
| 140 | # classes (UnixCCompiler, in particular) are driven by information |
| 141 | # discovered at run-time, since there are many different ways to do |
| 142 | # basically the same things with Unix C compilers. |
| 143 | |
| 144 | for key in kwargs: |
| 145 | if key not in self.executables: |
| 146 | raise ValueError("unknown executable '%s' for class %s" % |
| 147 | (key, self.__class__.__name__)) |
| 148 | self.set_executable(key, kwargs[key]) |
| 149 | |
| 150 | def set_executable(self, key, value): |
| 151 | if isinstance(value, str): |
no test coverage detected