HMPP: Fix isCommon calculation for the K2 HMPP case
This commit is contained in:
committed by
Space Team
parent
968dfddbc9
commit
76eda0095e
+5
-1
@@ -512,7 +512,11 @@ fun CompilerConfiguration.configureSourceRoots(chunk: List<Module>, buildFile: F
|
||||
val commonSources = getBuildFilePaths(buildFile, module.getCommonSourceFiles()).toSet()
|
||||
|
||||
for (path in getBuildFilePaths(buildFile, module.getSourceFiles())) {
|
||||
addKotlinSourceRoot(path, isCommon = path in commonSources, hmppCliModuleStructure?.getModuleNameForSource(path))
|
||||
addKotlinSourceRoot(
|
||||
path,
|
||||
isCommon = hmppCliModuleStructure?.isFromCommonModule(path) ?: (path in commonSources),
|
||||
hmppCliModuleStructure?.getModuleNameForSource(path)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,3 +23,7 @@ class HmppCliModuleStructure(
|
||||
fun HmppCliModuleStructure.getModuleNameForSource(source: String): String? {
|
||||
return modules.firstOrNull { source in it.sources }?.name
|
||||
}
|
||||
|
||||
fun HmppCliModuleStructure.isFromCommonModule(source: String): Boolean {
|
||||
return modules.indexOfFirst { source in it.sources }.let { it >= 0 && it < modules.size - 1 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user