1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-05 08:05:24 +02:00

Bug 487957 - Platform only includes.

Don't send the library includes to platform source compiles. This has
led to problems as specified in the bug. And they're really shouldn't
be necessary. Also Arduino IDE does things this way.

Change-Id: I70b37b660c98b88b3de18ec53e8b86a119fc0baf
This commit is contained in:
Doug Schaefer 2016-07-10 14:27:20 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent f663382363
commit 43746a954c
2 changed files with 16 additions and 10 deletions

View file

@ -229,8 +229,11 @@ public class ArduinoBuildConfiguration extends CBuildConfiguration
ArduinoBoard board = getBoard();
ArduinoPlatform platform = board.getPlatform();
Properties properties = new Properties();
Map<String, Object> buildModel = new HashMap<>();
buildModel.put("boardId", board.getId()); //$NON-NLS-1$
properties.put("object_file", "$@"); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("source_file", "$<"); //$NON-NLS-1$ //$NON-NLS-2$
// The list of source files in the project
final Path projectPath = new File(project.getLocationURI()).toPath();
@ -260,7 +263,6 @@ public class ArduinoBuildConfiguration extends CBuildConfiguration
buildModel.put("libraries_path", pathString(ArduinoPreferences.getArduinoHome().resolve("libraries"))); //$NON-NLS-1$ //$NON-NLS-2$
// the recipes
Properties properties = new Properties();
properties.putAll(getProperties());
buildModel.put("build_path", properties.get("build.path")); //$NON-NLS-1$ //$NON-NLS-2$
buildModel.put("project_name", project.getName()); //$NON-NLS-1$
@ -274,12 +276,18 @@ public class ArduinoBuildConfiguration extends CBuildConfiguration
}
includes += '"' + pathString(include) + '"';
}
// Magic recipes for platform builds with platform includes
properties.put("includes", includes); //$NON-NLS-1$
buildModel.put("recipe_cpp_o_pattern_plat", resolveProperty("recipe.cpp.o.pattern", properties)); //$NON-NLS-1$ //$NON-NLS-2$
buildModel.put("recipe_c_o_pattern_plat", resolveProperty("recipe.c.o.pattern", properties)); //$NON-NLS-1$ //$NON-NLS-2$
buildModel.put("recipe_S_o_pattern_plat", resolveProperty("recipe.S.o.pattern", properties)); //$NON-NLS-1$ //$NON-NLS-2$
for (ArduinoLibrary lib : manager.getLibraries(project)) {
for (Path include : lib.getIncludePath()) {
includes += " -I\"" + pathString(include) + '"'; //$NON-NLS-1$
}
}
properties.put("includes", includes); //$NON-NLS-1$
ArduinoPlatform corePlatform = platform;
String core = properties.getProperty("build.core"); //$NON-NLS-1$
@ -313,8 +321,6 @@ public class ArduinoBuildConfiguration extends CBuildConfiguration
}
buildModel.put("platform_variant_srcs", variantSources); //$NON-NLS-1$
properties.put("object_file", "$@"); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("source_file", "$<"); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("archive_file", "core.a"); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("archive_file_path", "{build.path}/{archive_file}"); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("object_files", "$(PROJECT_OBJS) $(LIBRARIES_OBJS)"); //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -130,7 +130,7 @@ ${build_path}/project/${cpp?groups[1]}.cpp.d: ;
<#if cpp>
${build_path}/core/${cpp?groups[1]}.cpp.o: ${file} ${build_path}/core/${cpp?groups[1]}.cpp.d
@$(call mymkdir,$(dir $@))
${recipe_cpp_o_pattern}
${recipe_cpp_o_pattern_plat}
${recipe_ar_pattern}
${build_path}/core/${cpp?groups[1]}.cpp.d: ;
@ -142,7 +142,7 @@ ${build_path}/core/${cpp?groups[1]}.cpp.d: ;
<#if c>
${build_path}/core/${c?groups[1]}.c.o: ${file} ${build_path}/core/${c?groups[1]}.c.d
@$(call mymkdir,$(dir $@))
${recipe_c_o_pattern}
${recipe_c_o_pattern_plat}
${recipe_ar_pattern}
${build_path}/core/${c?groups[1]}.c.d: ;
@ -154,7 +154,7 @@ ${build_path}/core/${c?groups[1]}.c.d: ;
<#if S>
${build_path}/core/${S?groups[1]}.S.o: ${file}
@$(call mymkdir,$(dir $@))
${recipe_S_o_pattern}
${recipe_S_o_pattern_plat}
${recipe_ar_pattern}
</#if>
@ -165,7 +165,7 @@ ${build_path}/core/${S?groups[1]}.S.o: ${file}
<#if cpp>
${build_path}/variant/${cpp?groups[1]}.cpp.o: ${file} ${build_path}/variant/${cpp?groups[1]}.cpp.d
@$(call mymkdir,$(dir $@))
${recipe_cpp_o_pattern}
${recipe_cpp_o_pattern_plat}
${recipe_ar_pattern}
${build_path}/variant/${cpp?groups[1]}.cpp.d: ;
@ -177,7 +177,7 @@ ${build_path}/variant/${cpp?groups[1]}.cpp.d: ;
<#if c>
${build_path}/variant/${c?groups[1]}.c.o: ${file} ${build_path}/variant/${c?groups[1]}.c.d
@$(call mymkdir,$(dir $@))
${recipe_c_o_pattern}
${recipe_c_o_pattern_plat}
${recipe_ar_pattern}
${build_path}/variant/${c?groups[1]}.c.d: ;
@ -189,7 +189,7 @@ ${build_path}/variant/${c?groups[1]}.c.d: ;
<#if S>
${build_path}/variant/${S?groups[1]}.S.o: ${file}
@$(call mymkdir,$(dir $@))
${recipe_S_o_pattern}
${recipe_S_o_pattern_plat}
${recipe_ar_pattern}
</#if>