def FindCompiler(env, mode, cmd): if "EMSDK" in os.environ and cmd[:2] == 'em': result = TryVerifyCompiler(env, mode, cmd, 'emscripten') if result is not None: return result if util.IsWindows(): result = TryVerifyCompiler(env, mode, cmd, 'msvc') if result is not None: return result return TryVerifyCompiler(env, mode, cmd, 'gcc')
def addSymlink(self, context, source, output_path): if util.IsWindows(): # Windows pre-Vista does not support symlinks. Windows Vista+ supports # symlinks via mklink, but it's Administrator-only by default. return self.addFileOp(nodetypes.Copy, context, source, output_path) if not self.symlink_support: self.had_symlink_fallback = True return self.addFileOp(nodetypes.Copy, context, source, output_path) return self.addFileOp(nodetypes.Symlink, context, source, output_path)
def TryVerifyCompiler(env, mode, cmd): if util.IsWindows(): cc = VerifyCompiler(env, mode, cmd, 'msvc') if cc: return cc return VerifyCompiler(env, mode, cmd, 'gcc')
def FindCompiler(env, mode, cmd): if util.IsWindows(): result = TryVerifyCompiler(env, mode, cmd, 'msvc') if result is not None: return result return TryVerifyCompiler(env, mode, cmd, 'gcc')
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # AMBuild is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AMBuild. If not, see <http://www.gnu.org/licenses/>. import os, sys from . import process from ambuild2 import util if util.IsWindows() or util.IsCygwin(): # Cygwin doesn't support SCM_RIGHTS (which, I guess, is actually unused) # but more importantly posix_spawn(), so we just cheat and use WinAPI # directly, ignoring the sketchy Unix layer. from . import windows as ipc_impl elif util.IsLinux(): from . import linux as ipc_impl elif util.IsBSD(): from . import bsd as ipc_impl else: import select if hasattr(select, 'poll'): from . import generic_poll as ipc_impl else: raise Exception('Unknown platform: ' + util.Platform())