src/CMakeLists.txt: always add upm include dirs to includes

Previously, the upm include dir was only added for C targets.  This
breaks when you have a C++ only target that depends on a C++/C driver.
Suddenly, you can't find header files like upm.h, upm_platform.h, etc.

This patch has the UPM include dirs always added for all targets.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson 2017-03-23 13:13:48 -06:00
parent f61b615704
commit b8fa948f7d

View File

@ -476,6 +476,12 @@ function (UPM_MIXED_MODULE_INIT)
# Make sure REQUIRES is a list
separate_arguments(UPM_MIXED_MODULE_INIT_REQUIRES)
# Always add the common header dirs to the includes list, even if we
# end up only building a C++ module. This is needed for cases where
# a C++ only driver depends on a mixed C++/C driver.
include_directories (${UPM_COMMON_HEADER_DIRS}
${CMAKE_SOURCE_DIR}/src/utilities)
# Always build C libs first
if (UPM_MIXED_MODULE_INIT_C_SRC)
set (libname ${UPM_MIXED_MODULE_INIT_NAME})
@ -494,10 +500,6 @@ function (UPM_MIXED_MODULE_INIT)
list (APPEND module_src ${UPM_MIXED_MODULE_INIT_FTI_SRC})
endif (BUILDFTI AND UPM_MIXED_MODULE_INIT_FTI_SRC)
# Add include directories for C
include_directories (${UPM_COMMON_HEADER_DIRS}
${CMAKE_SOURCE_DIR}/src/utilities)
# Set a flag to tell upm_module_init that it's building a C library
set (IS_C_LIBRARY TRUE)
upm_module_init(${UPM_MIXED_MODULE_INIT_REQUIRES})