Remove the need to export HPHP_HOME when building

"Detect" HPHP_HOME as the location of the main CMakeLists.txt
file and plumb it through to child scripts from there.
Esse commit está contido em:
Sara Golemon
2013-12-27 02:26:06 -08:00
commit 7f2b1ced80
5 arquivos alterados com 15 adições e 17 exclusões
+8 -12
Ver Arquivo
@@ -5,18 +5,14 @@ IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message(FATAL_ERROR "HHVM requires a 64bit OS") message(FATAL_ERROR "HHVM requires a 64bit OS")
ENDIF() ENDIF()
IF("$ENV{HPHP_HOME}" STREQUAL "") set(HPHP_HOME "$ENV{HPHP_HOME}")
message(FATAL_ERROR "You should set the HPHP_HOME environmental") if (NOT HPHP_HOME)
ENDIF() set(HPHP_HOME "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
message("Using HPHP_HOME == ${HPHP_HOME}")
file(TO_CMAKE_PATH "$ENV{HPHP_HOME}" HPHP_HOME) IF(NOT EXISTS "${HPHP_HOME}/CMake/HPHPSetup.cmake")
message(FATAL_ERROR "Invalid HPHP_HOME. Set it to the root of your hhvm tree, or run `cmake .` from there.")
IF(NOT IS_DIRECTORY ${HPHP_HOME})
message(FATAL_ERROR "The value of HPHP_HOME does not exist")
ENDIF()
IF(NOT EXISTS "${HPHP_HOME}/LICENSE.PHP")
message(FATAL_ERROR "The value of HPHP_HOME in incorrect")
ENDIF() ENDIF()
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
@@ -24,5 +20,5 @@ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/HPHPFunctions.cmake") include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/HPHPFunctions.cmake")
include(CheckFunctionExists) include(CheckFunctionExists)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/hphp) add_subdirectory(hphp)
+1 -2
Ver Arquivo
@@ -20,7 +20,6 @@ if [ "x${TRAVIS}" != "x" ]; then
fi fi
export CMAKE_PREFIX_PATH=`/bin/pwd`/.. export CMAKE_PREFIX_PATH=`/bin/pwd`/..
export HPHP_HOME=`/bin/pwd`
# install python-software-properties before trying to add a PPA # install python-software-properties before trying to add a PPA
sudo apt-get -y update sudo apt-get -y update
@@ -124,4 +123,4 @@ cmake .
echo "-------------------------------------------------------------------------" echo "-------------------------------------------------------------------------"
echo "Done. Now run:" echo "Done. Now run:"
echo " CMAKE_PREFIX_PATH=\`pwd\`/.. HPHP_HOME=\`pwd\` make" echo " CMAKE_PREFIX_PATH=\`pwd\`/.. make"
+2 -1
Ver Arquivo
@@ -21,7 +21,8 @@ macro(EXT_HHVM_FILE SOURCES HEADERS REL EHHVM_OS EHHVM_ARCH)
list(APPEND ${HEADERS} "${f_SRC}.ext_hhvm.h") list(APPEND ${HEADERS} "${f_SRC}.ext_hhvm.h")
add_custom_command(OUTPUT "${f_SRC}.ext_hhvm.cpp" "${f_SRC}.ext_hhvm.h" add_custom_command(OUTPUT "${f_SRC}.ext_hhvm.cpp" "${f_SRC}.ext_hhvm.h"
DEPENDS ${f_SRC} gen-ext-hhvm DEPENDS ${f_SRC} gen-ext-hhvm
COMMAND "${HPHP_HOME}/hphp/tools/bootstrap/gen-ext-hhvm.sh" COMMAND "HPHP_HOME=${HPHP_HOME}"
"${HPHP_HOME}/hphp/tools/bootstrap/gen-ext-hhvm.sh"
ARGS ${EHHVM_OS} ${EHHVM_ARCH} ${f_OBJ} ARGS ${EHHVM_OS} ${EHHVM_ARCH} ${f_OBJ}
"${f_SRC}.ext_hhvm.cpp" "${f_SRC}.ext_hhvm.h" "${f_SRC}.ext_hhvm.cpp" "${f_SRC}.ext_hhvm.h"
WORKING_DIRECTORY "${HPHP_HOME}/hphp/tools/bootstrap" WORKING_DIRECTORY "${HPHP_HOME}/hphp/tools/bootstrap"
+3 -1
Ver Arquivo
@@ -8,7 +8,9 @@ check_err()
fi fi
} }
[ -z "$HPHP_HOME" ] && check_err 1 "HPHP_HOME environment variable not set" if [ -z "$HPHP_HOME" ]; then
HPHP_HOME="`dirname $0`/../../"
fi
VERBOSE=1 VERBOSE=1
+1 -1
Ver Arquivo
@@ -11,7 +11,7 @@ endforeach()
add_custom_command( add_custom_command(
OUTPUT "${HPHP_HOME}/hphp/hphp-repo-schema.h" OUTPUT "${HPHP_HOME}/hphp/hphp-repo-schema.h"
"${HPHP_HOME}/hphp/hphp-build-info.cpp" "${HPHP_HOME}/hphp/hphp-build-info.cpp"
COMMAND "hphp/util/generate-buildinfo.sh" COMMAND "HPHP_HOME=${HPHP_HOME}" "hphp/util/generate-buildinfo.sh"
DEPENDS ${CXX_SOURCES} DEPENDS ${CXX_SOURCES}
WORKING_DIRECTORY ${HPHP_HOME} WORKING_DIRECTORY ${HPHP_HOME}
COMMENT "Generating Repo Schema ID and Compiler ID" COMMENT "Generating Repo Schema ID and Compiler ID"