org.gradle.nativeplatform.toolchain.internal.msvcpp.ArchitectureSpecificVisualCpp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-api Show documentation
Show all versions of gradle-api Show documentation
Gradle 6.9.1 API redistribution.
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.nativeplatform.toolchain.internal.msvcpp;
import org.gradle.util.VersionNumber;
import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class ArchitectureSpecificVisualCpp implements VisualCpp {
private static final String COMPILER_FILENAME = "cl.exe";
private static final String LINKER_FILENAME = "link.exe";
private static final String ARCHIVER_FILENAME = "lib.exe";
private final VersionNumber version;
private final List paths;
private final File binDir;
private final File libDir;
private final File includeDir;
private final String assemblerFilename;
private final Map definitions;
private final File compilerPath;
ArchitectureSpecificVisualCpp(VersionNumber version, List paths, File binDir, File libDir, File compilerPath, File includeDir, String assemblerFilename, Map definitions) {
this.version = version;
this.paths = paths;
this.binDir = binDir;
this.libDir = libDir;
this.includeDir = includeDir;
this.assemblerFilename = assemblerFilename;
this.definitions = definitions;
this.compilerPath = compilerPath;
}
@Override
public VersionNumber getImplementationVersion() {
return version;
}
@Override
public File getBinDir() {
return binDir;
}
@Override
public List getPath() {
return paths;
}
@Override
public File getCompilerExecutable() {
return new File(binDir, COMPILER_FILENAME);
}
@Override
public File getLinkerExecutable() {
return new File(binDir, LINKER_FILENAME);
}
@Override
public File getArchiverExecutable() {
return new File(binDir, ARCHIVER_FILENAME);
}
@Override
public File getAssemblerExecutable() {
return new File(binDir, assemblerFilename);
}
@Override
public List getLibDirs() {
return Collections.singletonList(libDir);
}
@Override
public List getIncludeDirs() {
return Collections.singletonList(includeDir);
}
@Override
public Map getPreprocessorMacros() {
return definitions;
}
public boolean isInstalled() {
return binDir.exists() && compilerPath.exists() && libDir.exists();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy