YARN-3827. Migrate YARN native build to new CMake framework (Alan Burlison via Colin P. McCabe)

(cherry picked from commit d0cc0380b5)
This commit is contained in:
Colin Patrick Mccabe 2015-06-30 16:24:19 -07:00
parent 604d1bbdb7
commit b1da58d23d
2 changed files with 14 additions and 12 deletions

View File

@ -269,6 +269,9 @@ Release 2.8.0 - UNRELEASED
YARN-3834. Scrub debug logging of tokens during resource localization. YARN-3834. Scrub debug logging of tokens during resource localization.
(Chris Nauroth via xgong) (Chris Nauroth via xgong)
YARN-3827. Migrate YARN native build to new CMake framework (Alan Burlison
via Colin P. McCabe)
OPTIMIZATIONS OPTIMIZATIONS
YARN-3339. TestDockerContainerExecutor should pull a single image and not YARN-3339. TestDockerContainerExecutor should pull a single image and not

View File

@ -16,25 +16,24 @@
cmake_minimum_required(VERSION 2.6 FATAL_ERROR) cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
set(CMAKE_BUILD_TYPE, Release) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../../../../../hadoop-common-project/hadoop-common)
include(HadoopCommon)
include(../../../../../hadoop-common-project/hadoop-common/src/JNIFlags.cmake NO_POLICY_SCOPE) # Note: can't use -D_FILE_OFFSET_BITS=64, see MAPREDUCE-4258
string(REPLACE "-D_FILE_OFFSET_BITS=64" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "-D_FILE_OFFSET_BITS=64" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
include(CheckFunctionExists) include(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(fcloseall HAVE_FCLOSEALL) check_function_exists(fcloseall HAVE_FCLOSEALL)
function(output_directory TGT DIR) function(output_directory TGT DIR)
SET_TARGET_PROPERTIES(${TGT} PROPERTIES set_target_properties(${TGT} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}") RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}")
SET_TARGET_PROPERTIES(${TGT} PROPERTIES set_target_properties(${TGT} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}") ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}")
SET_TARGET_PROPERTIES(${TGT} PROPERTIES set_target_properties(${TGT} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}") LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}")
endfunction(output_directory TGT DIR) endfunction()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O2 -D_GNU_SOURCE")
# note: can't enable -D_LARGEFILE: see MAPREDUCE-4258
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_REENTRANT")
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
@ -42,7 +41,7 @@ include_directories(
main/native/container-executor main/native/container-executor
main/native/container-executor/impl main/native/container-executor/impl
) )
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
add_library(container add_library(container
main/native/container-executor/impl/configuration.c main/native/container-executor/impl/configuration.c