Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cbuild2cmake] Trigger project executes after project build step #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/cbuild2cmake/commands/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,17 @@ add_dependencies(Archive_Artifacts
project.Release+ARMCM0-build
project.Release+ARMCM0-Sign_Artifact
)
add_dependencies(project.Release+ARMCM0-executes
Archive_Artifacts
)
add_dependencies(Run_After_Archiving
Archive_Artifacts
)
add_dependencies(project.Release+ARMCM0-Sign_Artifact
project.Release+ARMCM0-build
)
add_dependencies(project.Release+ARMCM0-executes
project.Release+ARMCM0-Sign_Artifact
)`)
})
}
7 changes: 7 additions & 0 deletions pkg/maker/buildcontent.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ func (m *Maker) BuildDependencies() string {
}
for _, item := range m.CbuildIndex.BuildIdx.Executes {
content += m.CMakeTargetAddDependencies(item.Execute, item.DependsOn)
// add executes statement to ${CONTEXT}-executes target of context
// if dependency is a context
for _, dependsOn := range item.DependsOn {
if slices.Contains(m.Contexts, dependsOn) {
content += m.CMakeTargetAddDependencies(dependsOn+"-executes", []string{item.Execute})
}
}
}
if len(content) > 0 {
content = "\n\n# Build dependencies" + content
Expand Down
8 changes: 7 additions & 1 deletion pkg/maker/superlists.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ foreach(INDEX RANGE ${CONTEXTS_LENGTH})
BUILD_BYPRODUCTS ${OUTPUTS_${N}}` + logConfigure + `
USES_TERMINAL_BUILD ON
)
ExternalProject_Add_StepTargets(${CONTEXT} build configure)

# Executes command step
ExternalProject_Add_Step(${CONTEXT} executes
DEPENDEES build
)

ExternalProject_Add_StepTargets(${CONTEXT} build configure executes)

# Debug
message(VERBOSE "Configure Context: ${CMAKE_COMMAND} -G Ninja -S ${DIR} -B ${N}")
Expand Down
8 changes: 7 additions & 1 deletion test/data/solutions/blanks/ref/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ foreach(INDEX RANGE ${CONTEXTS_LENGTH})
BUILD_BYPRODUCTS ${OUTPUTS_${N}}
USES_TERMINAL_BUILD ON
)
ExternalProject_Add_StepTargets(${CONTEXT} build configure)

# Executes command step
ExternalProject_Add_Step(${CONTEXT} executes
DEPENDEES build
)

ExternalProject_Add_StepTargets(${CONTEXT} build configure executes)

# Debug
message(VERBOSE "Configure Context: ${CMAKE_COMMAND} -G Ninja -S ${DIR} -B ${N}")
Expand Down
8 changes: 7 additions & 1 deletion test/data/solutions/pre-include-oot/ref/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ foreach(INDEX RANGE ${CONTEXTS_LENGTH})
BUILD_BYPRODUCTS ${OUTPUTS_${N}}
USES_TERMINAL_BUILD ON
)
ExternalProject_Add_StepTargets(${CONTEXT} build configure)

# Executes command step
ExternalProject_Add_Step(${CONTEXT} executes
DEPENDEES build
)

ExternalProject_Add_StepTargets(${CONTEXT} build configure executes)

# Debug
message(VERBOSE "Configure Context: ${CMAKE_COMMAND} -G Ninja -S ${DIR} -B ${N}")
Expand Down
Loading