summaryrefslogtreecommitdiff
path: root/cmake/jemalloc.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-09-23 23:33:18 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2013-09-23 23:33:18 +0200
commit11fc6b49d96931d08bb8d266270014c0633a0fa5 (patch)
treeaeb36f81a53f06a0b5ff7f9d3d6c34c1a075ecf0 /cmake/jemalloc.cmake
parentb722aae621cb2e4fc2f815292bce43cd5a73b342 (diff)
downloadmariadb-git-11fc6b49d96931d08bb8d266270014c0633a0fa5.tar.gz
MDEV-5053 - fix cyclic dependency when building with Ninja CMake generator
Diffstat (limited to 'cmake/jemalloc.cmake')
-rw-r--r--cmake/jemalloc.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 5cb9c493a20..fc7b2a73e72 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -15,13 +15,20 @@ MACRO (USE_BUNDLED_JEMALLOC)
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT APPLE) # see the comment in CMakeLists.txt
LIST(APPEND JEMALLOC_CONFIGURE_OPTS --enable-debug)
ENDIF()
+
+ IF(CMAKE_GENERATOR MATCHES "Makefiles")
+ SET(MAKE_COMMAND ${CMAKE_MAKE_PROGRAM})
+ ELSE() # Xcode/Ninja generators
+ SET(MAKE_COMMAND make)
+ ENDIF()
+
ExternalProject_Add(jemalloc
PREFIX extra/jemalloc
SOURCE_DIR ${SOURCE_DIR}
BINARY_DIR ${BINARY_DIR}
STAMP_DIR ${BINARY_DIR}
CONFIGURE_COMMAND "${SOURCE_DIR}/configure" ${JEMALLOC_CONFIGURE_OPTS}
- BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} "build_lib_static"
+ BUILD_COMMAND ${MAKE_COMMAND} "build_lib_static"
INSTALL_COMMAND ""
)
ADD_LIBRARY(libjemalloc STATIC IMPORTED)