0
私はジェネリック実装としてビルド時にjemallocライブラリを自分のアプリケーションにリンクしようとしています。 https://github.com/jemalloc/jemalloc/wiki/Getting-Startedによると、使用するリンクフラグは以下のとおりです。cmakeを使用してjemalloc共有ライブラリをリンクする方法
cmake_minimum_required(VERSION 2.8.12.2)
project(widget)
include_directories(include)
file(GLOB SOURCES "src/*.cpp")
add_executable(widget ${SOURCES})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L`jemalloc-config --libdir` -Wl,-rpath,`jemalloc-config --libdir` -ljemalloc `jemalloc-config --libs`")
しかし、私はmake
を行うとき、私は、次のエラー取得:
-L`jemalloc-config --libdir` -Wl,-rpath,`jemalloc-config --libdir` -ljemalloc `jemalloc-config --libs`
だから私は、次のCMakeLists.txtをした
をLinking CXX executable widget
c++: error: `jemalloc-config: No such file or directory
c++: error: unrecognized command line option ‘--libdir`’
c++: error: unrecognized command line option ‘--libdir`’
c++: error: unrecognized command line option ‘--libs`’
make[2]: *** [widget] Error 1
make[1]: *** [CMakeFiles/widget.dir/all] Error 2