MCPcopy Create free account
hub / github.com/Kitware/CMake / WriteCompilers

Method WriteCompilers

Source/cmGlobalFastbuildGenerator.cxx:883–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883void cmGlobalFastbuildGenerator::WriteCompilers()
884{
885 WriteDivider();
886 *this->BuildFileStream << "// Compilers\n\n";
887 for (auto const& val : Compilers) {
888 auto const& compilerDef = val.second;
889
890 std::string compilerPath = compilerDef.Executable;
891
892 // Write out the compiler that has been configured
893 WriteCommand("Compiler", Quote(compilerDef.Name));
894 *this->BuildFileStream << "{\n";
895 for (auto const& extra : compilerDef.ExtraVariables) {
896 auto const& extraKey = extra.first;
897 auto const& extraVal = extra.second;
898 WriteVariable(extraKey, Quote(extraVal), 1);
899 }
900 WriteVariable("Executable", Quote(compilerPath), 1);
901 WriteVariable("CompilerFamily", Quote(compilerDef.CompilerFamily), 1);
902 if (this->GetCMakeInstance()->GetIsInTryCompile()) {
903 WriteVariable("AllowCaching", "false", 1);
904 WriteVariable("AllowDistribution", "false", 1);
905 }
906
907 if (compilerDef.UseLightCache &&
908 (compilerDef.CompilerFamily == "msvc" ||
909 // FASTBuild supports Light Cache for non-MSVC compilers starting from
910 // version 1.19
911 cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER_EQUAL,
912 this->FastbuildVersion, "1.19"))) {
913 WriteVariable("UseLightCache_Experimental", "true", 1);
914 }
915 if (compilerDef.UseRelativePaths) {
916 WriteVariable("UseRelativePaths_Experimental", "true", 1);
917 }
918 if (compilerDef.UseDeterministicPaths) {
919 WriteVariable("UseDeterministicPaths_Experimental", "true", 1);
920 }
921
922 if (!compilerDef.SourceMapping.empty()) {
923 WriteVariable("SourceMapping_Experimental",
924 Quote(compilerDef.SourceMapping), 1);
925 }
926
927 auto const isClang = [&compilerDef] {
928 return compilerDef.CompilerFamily == "clang" ||
929 compilerDef.CompilerFamily == "clang-cl";
930 };
931
932 if (!compilerDef.ClangRewriteIncludes && isClang()) {
933 WriteVariable("ClangRewriteIncludes", "false", 1);
934 }
935 if (compilerDef.ClangGCCUpdateXLanguageArg &&
936 (isClang() || compilerDef.CompilerFamily == "gcc")) {
937 WriteVariable("ClangGCCUpdateXLanguageArg", "true", 1);
938 }
939
940 if (compilerDef.AllowResponseFile) {

Callers 1

GenerateMethod · 0.95

Calls 5

VersionCompareFunction · 0.85
GetIsInTryCompileMethod · 0.80
GetCMakeInstanceMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected