Skip to content

Commit 2d1e5d9

Browse files
facchinmcmaglie
authored andcommitted
restrict cmake project generation to platforms declaring compiler.export_cmake
1 parent 3803fa3 commit 2d1e5d9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

constants/constants.go

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const BUILD_PROPERTIES_COMPILER_LDFLAGS = "compiler.ldflags"
5252
const BUILD_PROPERTIES_COMPILER_CPP_FLAGS = "compiler.cpp.flags"
5353
const BUILD_PROPERTIES_COMPILER_PATH = "compiler.path"
5454
const BUILD_PROPERTIES_COMPILER_WARNING_FLAGS = "compiler.warning_flags"
55+
const BUILD_PROPERTIES_COMPILER_EXPORT_CMAKE_FLAGS = "compiler.export_cmake"
5556
const BUILD_PROPERTIES_EXTRA_TIME_DST = "extra.time.dst"
5657
const BUILD_PROPERTIES_EXTRA_TIME_LOCAL = "extra.time.local"
5758
const BUILD_PROPERTIES_EXTRA_TIME_UTC = "extra.time.utc"

src/arduino.cc/builder/create_cmake_rule.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
5555
//verbose := ctx.Verbose
5656
logger := ctx.GetLogger()
5757

58-
if s.SketchError {
58+
if s.SketchError || !canExportCmakeProject(ctx) {
5959
return nil
6060
}
6161

@@ -178,6 +178,10 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
178178
return nil
179179
}
180180

181+
func canExportCmakeProject(ctx *types.Context) bool {
182+
return ctx.BuildProperties[constants.BUILD_PROPERTIES_COMPILER_EXPORT_CMAKE_FLAGS] != ""
183+
}
184+
181185
func extractCompileFlags(ctx *types.Context, receipe string, defines, libs, linkerflags, linkDirectories *[]string, logger i18n.Logger) {
182186
command, _ := builder_utils.PrepareCommandForRecipe(ctx.BuildProperties, receipe, true, false, false, logger)
183187

0 commit comments

Comments
 (0)