Skip to content

Commit

Permalink
Modify modulemap path
Browse files Browse the repository at this point in the history
  • Loading branch information
imorlxs committed Sep 17, 2024
1 parent a399cb5 commit 43f415d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmake/BioDynaMo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ function(build_shared_library TARGET)
set(DICT_FILE "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET}_dict")
set(BDM_DICT_FILE "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET}_bdm_dict.cc")
set(module "${TARGET}")
set(ROOT_HEADERS)
string(REPLACE "${CMAKE_SOURCE_DIR}/src/" "" ROOT_HEADERS_TEMP "${ARG_HEADERS}")
string(REPLACE "${CMAKE_SOURCE_DIR}/test/" "" ROOT_HEADERS "${ROOT_HEADERS_TEMP}")


if (runtime_cxxmodules)
set(MODULEMAP "--moduleMapFile=${CMAKE_SOURCE_DIR}/src/module.modulemap")
set(CLING_MODULEMAP_FILES "$ENV{${CMAKE_BINARY_DIR}/include/module.modulemap}")
endif()

if (NOT ${TARGET} STREQUAL "biodynamo")
Expand All @@ -129,7 +133,7 @@ function(build_shared_library TARGET)
if(NOT DEFINED BDM_CMAKE_DIR)
set(BDM_CMAKE_DIR $ENV{BDMSYS}/share/cmake)
endif()
ROOT_GENERATE_DICTIONARY(${DICT_FILE} ${ARG_HEADERS} MODULE ${module} LINKDEF ${BDM_CMAKE_DIR}/${ARG_SELECTION} REFLEX ${NO_MODULE} OPTIONS ${DEPENDENCY_OPTION} -I src --inlineInputHeader --noIncludePaths ${MODULEMAP})
ROOT_GENERATE_DICTIONARY(${DICT_FILE} ${ROOT_HEADERS} MODULE ${module} LINKDEF ${BDM_CMAKE_DIR}/${ARG_SELECTION} REFLEX ${NO_MODULE} OPTIONS ${DEPENDENCY_OPTION} -I src --inlineInputHeader --noIncludePaths ${MODULEMAP})
if (BDM_OUT_OF_SOURCE)
set(BDM_DICT_BIN_PATH "$ENV{BDMSYS}/bin")
else()
Expand Down
2 changes: 1 addition & 1 deletion cmake/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ function (ROOT_CXXMODULES_APPEND_TO_MODULEMAP library library_headers)
# exposed via the main modulemap. This is exposed by setting the
# ROOT_CXXMODULES_WRITE_TO_CURRENT_DIR.
if (NOT "${CMAKE_PROJECT_NAME}" STREQUAL ROOT OR ROOT_CXXMODULES_WRITE_TO_CURRENT_DIR)
set(modulemap_output_file "${CMAKE_SOURCE_DIR}/src/module.modulemap")
set(modulemap_output_file "${CMAKE_BINARY_DIR}/include/module.modulemap")

# It's possible that multiple modulemaps are needed in the current
# directory and we need to merge them. As we don't want to have multiple
Expand Down

0 comments on commit 43f415d

Please sign in to comment.