[LLVMdev] Building module with cmake error

Diogo Sampaio dnsampaio at gmail.com
Sun Aug 24 10:02:58 PDT 2014


Hi LLVMers,

I followed the instructions from http://llvm.org/docs/CMake.html to
build a loadable module. Trying to use the cmake function
"add_llvm_loadable_module" I'm getting this error:

-- ddg-instr ignored -- Loadable modules not supported on this platform.

The important part of CMakeLists.txt files are:
----base----
cmake_minimum_required(VERSION 2.8.8)
find_package(LLVM REQUIRED CONFIG)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
include_directories( ${LLVM_INCLUDE_DIRS} )
add_definitions( ${LLVM_DEFINITIONS} )
link_directories( ${LLVM_LIBRARY_DIRS} )
llvm_map_components_to_libnames(REQ_LLVM_LIBRARIES support native)
add_subdirectory(lib/instrument)

----inside lib/instrument folder:
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
add_llvm_loadable_module(ddg-instr
  InstrumentDDG.cxx
  Visitors.cxx
)
#add_library(ddg-instr MODULE
#       InstrumentDDG.cxx
#       Visitors.cxx
#)
#install(TARGETS ddg-instr LIBRARY DESTINATION lib)
-------------
Is there anything I missed here? Using the commented add_library and
install works, but the file is prefixed with lib which I don't desire.
Any help would be appreciated.

More details on my system:
Fedora release 20 (Heisenbug) x86_64
cmake version 2.8.12.2
gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1)
Linux geraldo 3.15.10-200.fc20.x86_64 #1 SMP Thu Aug 14 15:39:24 UTC
2014 x86_64 x86_64 x86_64 GNU/Linux

Regards
-- 
Diogo Nunes Sampaio



More information about the llvm-dev mailing list