Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Revert "[cxxmodule] Fix nightlies (#2577)"
This reverts commit 316f553.
  • Loading branch information
yamaguchi1024 committed Sep 24, 2018
commit ee12b2cd2d309d76fa8b6825d4f309f66e7a6c8f
2 changes: 1 addition & 1 deletion cmake/modules/RootNewMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)

if(CMAKE_PROJECT_NAME STREQUAL ROOT)
set(includedirs -I${CMAKE_SOURCE_DIR}
-I${CMAKE_SOURCE_DIR}/interpreter/cling/include # This is for the RuntimeUniverse
Copy link
Member

Choose a reason for hiding this comment

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

This will likely not build a module for RuntimUniverse.h and friends.

-I${CMAKE_BINARY_DIR}/etc/cling/ # This is for the RuntimeUniverse
-I${CMAKE_BINARY_DIR}/include)
set(excludepaths ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc)
Expand Down
27 changes: 16 additions & 11 deletions core/clingutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ ROOT_GLOB_HEADERS(headers ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h)

set(ClingUtils_dict_headers ${headers} PARENT_SCOPE)

ROOT_OBJECT_LIBRARY(ClingUtils ${sources})
add_dependencies(ClingUtils CLING)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/res ${CMAKE_CURRENT_SOURCE_DIR}/../foundation/res)
include_directories(${CLING_INCLUDE_DIRS})
target_include_directories(ClingUtils PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/res ${CMAKE_CURRENT_SOURCE_DIR}/../foundation/res)
target_include_directories(ClingUtils PRIVATE ${CLING_INCLUDE_DIRS})
# Register the llvm include directories after clangs. This instructs the compiler to resolve
# headers from our builtin clang. That's an issue when we are building with bultin_llvm=Off
# and we have installed clang headers, too.
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS})
target_include_directories(ClingUtils PRIVATE SYSTEM ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLING_CXXFLAGS}")

# This is to avoid warnings coming from GCC 7 in llvm/src/include/llvm/ADT/DenseMap.h:1010
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS -Wno-maybe-uninitialized)
endif()

ROOT_OBJECT_LIBRARY(ClingUtils ${sources})

add_dependencies(ClingUtils CLING)

ROOT_INSTALL_HEADERS()

#### STL dictionary (replacement for cintdlls)##############################
Expand Down Expand Up @@ -87,18 +85,25 @@ install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/cling/lib/clang/${CLANG_RESOURCE_DIR_V
#---Install a bunch of files to /etc/cling------------------------------------
set(clinginclude ${CMAKE_SOURCE_DIR}/interpreter/cling/include)

foreach(file Interpreter/DynamicExprInfo.h
foreach(file module.modulemap.build
Interpreter/DynamicExprInfo.h
Interpreter/DynamicLookupRuntimeUniverse.h
Interpreter/DynamicLookupLifetimeHandler.h
Interpreter/Exception.h
Interpreter/RuntimePrintValue.h
Interpreter/RuntimeUniverse.h
Interpreter/Value.h)
get_filename_component(path ${file} PATH)
list(APPEND copy_commands COMMAND ${CMAKE_COMMAND} -E copy ${clinginclude}/cling/${file} ${CMAKE_BINARY_DIR}/etc/cling/${file})
set(dest_file ${file})
if (${file} STREQUAL "module.modulemap.build")
set(dest_file "module.modulemap")
else()
# We do not want our modulemap to be considered part of the PCH.
set_property(GLOBAL APPEND PROPERTY CLINGETCPCH etc/cling/${dest_file})
endif()
list(APPEND copy_commands COMMAND ${CMAKE_COMMAND} -E copy ${clinginclude}/cling/${file} ${CMAKE_BINARY_DIR}/etc/cling/${dest_file})
list(APPEND files_to_copy ${clinginclude}/cling/${file})
set_property(GLOBAL APPEND PROPERTY CLINGETCPCH etc/cling/${file})
install(FILES ${clinginclude}/cling/${file} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cling/${path})
install(FILES ${CMAKE_BINARY_DIR}/etc/cling/${dest_file} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cling/${path})
endforeach()

foreach(file multimap multiset)
Expand Down
25 changes: 13 additions & 12 deletions core/dictgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@

ROOT_GLOB_SOURCES(sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/res
${CMAKE_CURRENT_SOURCE_DIR}/../foundation/res
${CMAKE_CURRENT_SOURCE_DIR}/../clingutils/res)
include_directories(${CLING_INCLUDE_DIRS})
ROOT_OBJECT_LIBRARY(Dictgen
${sources}
)
add_dependencies(Dictgen CLING)

target_include_directories(Dictgen PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/res
${CMAKE_CURRENT_SOURCE_DIR}/../foundation/res
${CMAKE_CURRENT_SOURCE_DIR}/../clingutils/res
)
target_include_directories(Dictgen PRIVATE ${CLING_INCLUDE_DIRS})
# Register the llvm include directories after clangs. This instructs the compiler to resolve
# headers from our builtin clang. That's an issue when we are building with bultin_llvm=Off
# and we have installed clang headers, too.
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS})
target_include_directories(Dictgen PRIVATE SYSTEM ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLING_CXXFLAGS}")
CHECK_CXX_COMPILER_FLAG("-fno-rtti" CXX_HAS_fno_rtti)
Expand All @@ -27,9 +34,3 @@ if(CXX_HAS_fno_rtti)
set_source_files_properties(src/LinkdefReader.cxx PROPERTIES COMPILE_FLAGS "-fno-rtti")
set_source_files_properties(src/TModuleGenerator.cxx PROPERTIES COMPILE_FLAGS "-fno-rtti")
endif()

ROOT_OBJECT_LIBRARY(Dictgen
${sources}
)

add_dependencies(Dictgen CLING)
21 changes: 16 additions & 5 deletions interpreter/cling/include/cling/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
// Only included at runtime.
module Cling_Runtime {
module "RuntimeUniverse.h" { header "Interpreter/RuntimeUniverse.h" export * }
module "DynamicLookupRuntimeUniverse.h" { header "Interpreter/DynamicLookupRuntimeUniverse.h" export * }
module "RuntimePrintValue.h" { header "Interpreter/RuntimePrintValue.h" export * }
export *
}

// Included in both compile time and runtime.
module Cling_Runtime_Extra {
module "DynamicExprInfo.h" { header "Interpreter/DynamicExprInfo.h" export * }
module "DynamicLookupLifetimeHandler.h" { header "Interpreter/DynamicLookupLifetimeHandler.h" export * }
module "Value.h" { header "Interpreter/Value.h" export * }
export *
}

module Cling_Interpreter {
requires cplusplus
umbrella "Interpreter"

textual header "Interpreter/ClingOptions.inc"

// Only included at runtime.
exclude header "Interpreter/RuntimeUniverse.h"
exclude header "Interpreter/DynamicLookupRuntimeUniverse.h"
exclude header "Interpreter/RuntimePrintValue.h"

module * { export * }
}

Expand Down
15 changes: 15 additions & 0 deletions interpreter/cling/include/cling/module.modulemap.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Only included at runtime.
module Cling_Runtime {
module "RuntimeUniverse.h" { header "Interpreter/RuntimeUniverse.h" export * }
module "DynamicLookupRuntimeUniverse.h" { header "Interpreter/DynamicLookupRuntimeUniverse.h" export * }
module "RuntimePrintValue.h" { header "Interpreter/RuntimePrintValue.h" export * }
export *
}

// Included in both compile time and runtime.
module Cling_Runtime_Extra {
module "DynamicExprInfo.h" { header "Interpreter/DynamicExprInfo.h" export * }
module "DynamicLookupLifetimeHandler.h" { header "Interpreter/DynamicLookupLifetimeHandler.h" export * }
module "Value.h" { header "Interpreter/Value.h" export * }
export *
}