cmake: fix the creation dummy main to avoid rebuilding
This commit is contained in:
parent
9921c8b91f
commit
dbeb8ae02a
1 changed files with 4 additions and 1 deletions
|
@ -188,7 +188,10 @@ function(idf_add_executable)
|
|||
# Create a dummy file to work around CMake requirement of having a source
|
||||
# file while adding an executable
|
||||
add_executable(${exe_target} "${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c")
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c)
|
||||
add_custom_command(OUTPUT dummy_main_src.c
|
||||
COMMAND ${CMAKE_COMMAND} -E touch dummy_main_src.c
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(dummy_main_src DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c)
|
||||
|
||||
|
|
Loading…
Reference in a new issue