Skip to content

Commit

Permalink
Merge pull request #1073 from tony/gmake
Browse files Browse the repository at this point in the history
Search for gmake and make when building
  • Loading branch information
kmod committed Jan 29, 2016
2 parents 523ecd6 + 055c8c1 commit 068a3de
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release" AND NOT ${CMAKE_BUILD_TYPE} STREQU
message(FATAL_ERROR "CMAKE_BUILD_TYPE must be set to Release or Debug")
endif()

if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
if(MAKE_PRG)
execute_process(
COMMAND "${MAKE_PRG}" --version
OUTPUT_VARIABLE MAKE_VERSION_INFO)
if(NOT "${OUTPUT_VARIABLE}" MATCHES ".*GNU.*")
unset(MAKE_PRG)
endif()
endif()
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
else()
message(STATUS "Found GNU Make at ${MAKE_PRG}")
endif()
endif()

option(ENABLE_CCACHE "enable caching compiler output" ON)
option(ENABLE_EXTRA_TESTS "pyston extra tests" OFF)
option(ENABLE_GIL "threading use GIL" ON)
Expand Down Expand Up @@ -122,7 +139,8 @@ ExternalProject_Add(libjemalloc
DEPENDS gitsubmodules
UPDATE_COMMAND autoconf
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/build_deps/jemalloc/configure --prefix=${CMAKE_BINARY_DIR}/jemalloc --enable-autogen --enable-prof-libunwind
INSTALL_COMMAND make install_bin install_lib
BUILD_COMMAND ${MAKE_PRG}
INSTALL_COMMAND ${MAKE_PRG} install_bin install_lib
LOG_UPDATE ON
LOG_CONFIGURE ON
LOG_BUILD ON
Expand Down Expand Up @@ -197,7 +215,7 @@ ExternalProject_Add(libunwind
DEPENDS libunwind_patched
UPDATE_COMMAND autoreconf -i
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/build_deps/libunwind/configure ${LIBUNWIND_DEBUG_CFLAGS} --prefix=${CMAKE_BINARY_DIR}/build_deps/libunwind --enable-shared=0 --disable-block-signals ${LIBUNWIND_CONSERVATIVE_CHECKS} ${LIBUNWIND_DEBUG} ${LIBUNWIND_DEBUG_FRAME}
BUILD_COMMAND make -j${TEST_THREADS}
BUILD_COMMAND ${MAKE_PRG} -j${TEST_THREADS}
LOG_UPDATE ON
LOG_CONFIGURE ON
LOG_BUILD ON
Expand Down

0 comments on commit 068a3de

Please sign in to comment.