Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix that the generated parts of the modulemap were missing.
This happened when we moved the cxxmodules code before the add_subdirectory
which where responsible for filling the variable that contains the generated
contents. With this patch we wait with writing the variable contents to the
file until the variable actually contains the whole modulemap.
  • Loading branch information
Teemperor committed Mar 29, 2017
commit ca410123e72f819786a88aaa2bc3dfc820eb1501
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ if(cxxmodules)
DEPENDS build/unix/module.modulemap
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/build/unix/module.modulemap ${CMAKE_BINARY_DIR}/include/module.modulemap
)
get_property(__modulemap_extra_content GLOBAL PROPERTY ROOT_CXXMODULES_EXTRA_MODULEMAP_CONTENT)
string(REPLACE ";" "" __modulemap_extra_content "${__modulemap_extra_content}")
file(WRITE "${CMAKE_BINARY_DIR}/include/module.modulemap.extra" "${__modulemap_extra_content}")
add_custom_command(TARGET copymodulemap POST_BUILD
COMMAND cat "${CMAKE_BINARY_DIR}/include/module.modulemap.extra" >> ${CMAKE_BINARY_DIR}/include/module.modulemap
VERBATIM
Expand Down Expand Up @@ -228,6 +225,14 @@ endif()
ROOT_ADD_TEST_SUBDIRECTORY(test)
ROOT_ADD_TEST_SUBDIRECTORY(tutorials)

#---CXX MODULES-----------------------------------------------------------------------------------
# Take all the modulemap contents we collected from the packages and append them to our modulemap.
# We have to delay this because the ROOT_CXXMODULES_EXTRA_MODULEMAP_CONTENT is filled in the
# add_subdirectory calls above.
get_property(__modulemap_extra_content GLOBAL PROPERTY ROOT_CXXMODULES_EXTRA_MODULEMAP_CONTENT)
string(REPLACE ";" "" __modulemap_extra_content "${__modulemap_extra_content}")
file(WRITE "${CMAKE_BINARY_DIR}/include/module.modulemap.extra" "${__modulemap_extra_content}")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the extra new line?

get_property(__allHeaders GLOBAL PROPERTY ROOT_HEADER_TARGETS)
add_custom_target(move_headers ALL DEPENDS ${__allHeaders})

Expand Down