From b8fa948f7d6d72159fa9a9871eda911e4cf6642f Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Thu, 23 Mar 2017 13:13:48 -0600 Subject: [PATCH] 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 --- src/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2395b2b3..e3b9c85c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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})