unittest: Only add main.c if it exists
Downstream it's easier to write tests that use target_sources after including the unittest package instead of specifying a list of sources before. But if we do that, currently, main.c is added and the build breaks because it doesn't exist. Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
parent
bea16cae3a
commit
9cebf732ee
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ if((NOT DEFINED ZEPHYR_BASE) AND (DEFINED ENV_ZEPHYR_BASE))
|
|||
set(ZEPHYR_BASE ${ENV_ZEPHYR_BASE} CACHE PATH "Zephyr base")
|
||||
endif()
|
||||
|
||||
if(NOT SOURCES)
|
||||
if(NOT SOURCES AND EXISTS main.c)
|
||||
set(SOURCES main.c)
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue