Skip to content

Commit

Permalink
wip: query xcodeinfo only if local toolchain is used
Browse files Browse the repository at this point in the history
  • Loading branch information
ujohnny committed Dec 11, 2024
1 parent f9af31b commit ac3b954
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cpp/src/com/google/idea/blaze/cpp/BlazeConfigurationResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,12 @@
import com.intellij.openapi.util.registry.Registry;
import java.io.IOException;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Optional;
import java.util.*;

import org.jetbrains.annotations.NotNull;

import javax.annotation.Nullable;
import java.io.File;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -96,8 +92,15 @@ public BlazeConfigurationResolverResult update(
BlazeConfigurationToolchainResolver.buildToolchainLookupMap(
context, blazeProjectData.getTargetMap());

Optional<XcodeCompilerSettings> xcodeSettings =
BlazeConfigurationToolchainResolver.resolveXcodeCompilerSettings(context, project);
Set<CToolchainIdeInfo> projectToolchains = new HashSet<>(toolchainLookupMap.values());

Optional<XcodeCompilerSettings> xcodeSettings;
if (projectToolchains.stream().anyMatch(cToolchainIdeInfo -> cToolchainIdeInfo.getTargetName().equals("local"))) {
xcodeSettings = BlazeConfigurationToolchainResolver.resolveXcodeCompilerSettings(context, project);
}
else {
xcodeSettings = Optional.empty();
}

ImmutableMap<CToolchainIdeInfo, BlazeCompilerSettings> compilerSettings =
BlazeConfigurationToolchainResolver.buildCompilerSettingsMap(
Expand Down

0 comments on commit ac3b954

Please sign in to comment.