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})