Browse Source

cmake: Add gdbjit and oprofile options.

v0.7.4-release
Tom Hughes 14 years ago
committed by Ryan Dahl
parent
commit
9d49c93cb5
  1. 3
      CMakeLists.txt
  2. 18
      cmake/v8_build.cmake

3
CMakeLists.txt

@ -25,7 +25,8 @@ option(SHARED_V8 "use system shared V8 library")
option(SHARED_LIBEV "use system shared libev library") option(SHARED_LIBEV "use system shared libev library")
option(SHARED_CARES "use system shared c-ares library") option(SHARED_CARES "use system shared c-ares library")
option(V8_SNAPSHOT "turn on snapshot when building stock v8") option(V8_SNAPSHOT "turn on snapshot when building stock v8")
option(V8_OPROFILE "Add oprofile support")
option(V8_GDBJIT "add gdbjit support")
# cmake policies to get rid of some warnings # cmake policies to get rid of some warnings
cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks

18
cmake/v8_build.cmake

@ -14,7 +14,15 @@ endif()
if(NOT SHARED_V8) if(NOT SHARED_V8)
if(V8_SNAPSHOT) if(V8_SNAPSHOT)
set(v8snapshot snapshot=on) set(v8_snapshot snapshot=on)
endif()
if(V8_OPROFILE)
set(v8_oprofile prof=oprofile)
endif()
if(V8_GDBJIT)
set(v8_gdbjit gdbjit=on)
endif() endif()
if(${node_platform} MATCHES darwin) if(${node_platform} MATCHES darwin)
@ -40,6 +48,9 @@ if(NOT SHARED_V8)
set(compile_env_vars "CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CFLAGS=\"${CMAKE_C_FLAGS}\" CXXFLAGS=\"${CMAKE_CXX_FLAGS}\" LDFLAGS=\"${CMAKE_EXE_LINKER_FLAGS}\"") set(compile_env_vars "CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CFLAGS=\"${CMAKE_C_FLAGS}\" CXXFLAGS=\"${CMAKE_CXX_FLAGS}\" LDFLAGS=\"${CMAKE_EXE_LINKER_FLAGS}\"")
set(compile_cmd "${compile_env_vars} ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py -j ${parallel_jobs} visibility=default mode=${v8mode} arch=${v8arch} library=static ${v8_snapshot} ${v8_oprofile} ${v8_gdbjit} verbose=on")
if(CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8) if(CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
# use ExternalProject for CMake >2.8 # use ExternalProject for CMake >2.8
include(ExternalProject) include(ExternalProject)
@ -48,8 +59,7 @@ if(NOT SHARED_V8)
URL ${PROJECT_SOURCE_DIR}/deps/v8 URL ${PROJECT_SOURCE_DIR}/deps/v8
BUILD_IN_SOURCE True BUILD_IN_SOURCE True
BUILD_COMMAND sh -c "${compile_env_vars} ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}" BUILD_COMMAND sh -c "${compile_cmd}"
SOURCE_DIR ${PROJECT_BINARY_DIR}/deps/v8 SOURCE_DIR ${PROJECT_BINARY_DIR}/deps/v8
# ignore this stuff, it's not needed for building v8 but ExternalProject # ignore this stuff, it's not needed for building v8 but ExternalProject
# demands these steps # demands these steps
@ -79,7 +89,7 @@ if(NOT SHARED_V8)
add_custom_command( add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn} OUTPUT ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}
COMMAND sh -c "${compile_env_vars} ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}" COMMAND sh -c "${compile_cmd}"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8/ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8/
DEPENDS ${v8_sources_dest} DEPENDS ${v8_sources_dest}
) )

Loading…
Cancel
Save