cmake: Ninja: Fix the external_lib sample
This samples was failing to build with Ninja because Ninja detected that libmylib.a was missing. Adding it as a BYPRODUCT in the ExternalProject fixes the issue. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
1c2de10c06
commit
47542598b6
|
@ -27,6 +27,10 @@ include(ExternalProject)
|
|||
# been committed to the repository.
|
||||
set(mylib_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/mylib)
|
||||
set(mylib_build_dir ${CMAKE_CURRENT_BINARY_DIR}/mylib)
|
||||
|
||||
set(MYLIB_LIB_DIR ${mylib_build_dir}/lib)
|
||||
set(MYLIB_INCLUDE_DIR ${mylib_src_dir}/include)
|
||||
|
||||
ExternalProject_Add(
|
||||
mylib_project # Name for custom target
|
||||
PREFIX ${mylib_build_dir} # Root dir for entire project
|
||||
|
@ -39,9 +43,8 @@ ExternalProject_Add(
|
|||
CC=${CMAKE_C_COMPILER}
|
||||
CFLAGS=${external_project_cflags}
|
||||
INSTALL_COMMAND "" # This particular build system has no install command
|
||||
BUILD_BYPRODUCTS ${MYLIB_LIB_DIR}/libmylib.a
|
||||
)
|
||||
set(MYLIB_INCLUDE_DIR ${mylib_src_dir}/include)
|
||||
set(MYLIB_LIB_DIR ${mylib_build_dir}/lib)
|
||||
|
||||
# Create a wrapper CMake library that our app can link with
|
||||
add_library(mylib_lib STATIC IMPORTED)
|
||||
|
|
Loading…
Reference in a new issue