Skip to content

Commit f310e5d

Browse files
authored
[cbuild2cmake] Add USES_TERMINAL for executes custom target/command
1 parent 2c38fc2 commit f310e5d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pkg/maker/buildcontent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ func (m *Maker) ExecutesCommands(executes []Executes) string {
926926
if len(item.Output) > 0 {
927927
customTarget += "\n BYPRODUCTS ${OUTPUT}"
928928
}
929-
customTarget += "\n)"
929+
customTarget += "\n USES_TERMINAL\n)"
930930
} else {
931931
customTarget += " DEPENDS ${OUTPUT})"
932932
}
@@ -951,7 +951,7 @@ func (m *Maker) ExecutesCommands(executes []Executes) string {
951951
if !executeCommandNameAdded {
952952
customCommand += "\n COMMAND ${CMAKE_COMMAND} -E echo \"Executing: " + item.Execute + "\""
953953
}
954-
customCommand += "\n COMMAND " + QuoteArguments(item.Run) + "\n)"
954+
customCommand += "\n COMMAND " + QuoteArguments(item.Run) + "\n USES_TERMINAL\n)"
955955
content += customCommand
956956
}
957957
}

test/data/solutions/executes/ref/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ add_custom_target(Archive_Artifacts ALL DEPENDS ${OUTPUT})
8888
add_custom_command(OUTPUT ${OUTPUT} DEPENDS ${INPUT}
8989
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Archive_Artifacts"
9090
COMMAND ${CMAKE_COMMAND} -DINPUT="${INPUT}" -DOUTPUT="${OUTPUT}" -P "${INPUT_0}"
91+
USES_TERMINAL
9192
)
9293

9394
# Execute: Generate_Project_Sources
@@ -107,6 +108,7 @@ add_custom_target(Generate_Project_Sources ALL DEPENDS ${OUTPUT})
107108
add_custom_command(OUTPUT ${OUTPUT} DEPENDS ${INPUT}
108109
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Generate_Project_Sources"
109110
COMMAND ${CMAKE_COMMAND} -DINPUT_1="${INPUT_1}" -DOUTPUT_0="${OUTPUT_0}" -DOUTPUT_1="${OUTPUT_1}" -P "${INPUT_0}"
111+
USES_TERMINAL
110112
)
111113

112114
# Execute: Run_After_Archiving
@@ -121,18 +123,21 @@ add_custom_command(OUTPUT ${OUTPUT} DEPENDS ${INPUT}
121123
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Run_After_Archiving"
122124
COMMAND ${CMAKE_COMMAND} -E touch "Run_After_Archiving.stamp"
123125
COMMAND ${CMAKE_COMMAND} -E echo "Archive has been updated"
126+
USES_TERMINAL
124127
)
125128

126129
# Execute: Run_Always1
127130
add_custom_target(Run_Always1 ALL
128131
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Run_Always1"
129132
COMMAND ${CMAKE_COMMAND} -E echo "Execute Run Always1"
133+
USES_TERMINAL
130134
)
131135

132136
# Execute: Run_Always2
133137
add_custom_target(Run_Always2 ALL
134138
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Run_Always2"
135139
COMMAND ${CMAKE_COMMAND} -E echo "Execute Run Always2"
140+
USES_TERMINAL
136141
)
137142

138143
# Execute: project.Release+ARMCM0-Sign_Artifact
@@ -148,6 +153,7 @@ add_custom_target(project.Release+ARMCM0-Sign_Artifact ALL DEPENDS ${OUTPUT})
148153
add_custom_command(OUTPUT ${OUTPUT} DEPENDS ${INPUT}
149154
COMMAND ${CMAKE_COMMAND} -E echo "Executing: project.Release+ARMCM0-Sign_Artifact"
150155
COMMAND ${CMAKE_COMMAND} -DINPUT="${INPUT}" -DOUTPUT="${OUTPUT}" -P "${INPUT_0}"
156+
USES_TERMINAL
151157
)
152158

153159
# Build dependencies

test/data/solutions/image-only/ref/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ add_custom_target(Convert_Image1 ALL DEPENDS ${OUTPUT})
1818
add_custom_command(OUTPUT ${OUTPUT} DEPENDS ${INPUT}
1919
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Convert_Image1"
2020
COMMAND ${CMAKE_COMMAND} -E echo "Simulate image conversion 1 > 2" && ${CMAKE_COMMAND} -E copy "${INPUT_0}" "${OUTPUT_0}"
21+
USES_TERMINAL
2122
)
2223

2324
# Execute: Convert_Image2
@@ -33,6 +34,7 @@ add_custom_target(Convert_Image2 ALL DEPENDS ${OUTPUT})
3334
add_custom_command(OUTPUT ${OUTPUT} DEPENDS ${INPUT}
3435
COMMAND ${CMAKE_COMMAND} -E echo "Executing: Convert_Image2"
3536
COMMAND ${CMAKE_COMMAND} -E echo "Simulate image conversion 2 > 3" && ${CMAKE_COMMAND} -E copy "${INPUT_0}" "${OUTPUT_0}"
37+
USES_TERMINAL
3638
)
3739

3840
# Build dependencies

0 commit comments

Comments
 (0)