summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tom.hughes@palm.com>2011-02-11 20:52:42 -0600
committerRyan Dahl <ry@tinyclouds.org>2011-02-18 10:45:17 -0800
commit9d49c93cb54e08fc79f0f52fbce1483ff274f8ba (patch)
tree0c0d817e76d0ea8cd38429e8d918e6faca445819
parentde2686c3e101f991fb1fa831c8593a1b95616665 (diff)
downloadnodejs-9d49c93cb54e08fc79f0f52fbce1483ff274f8ba.tar.gz
nodejs-9d49c93cb54e08fc79f0f52fbce1483ff274f8ba.tar.bz2
nodejs-9d49c93cb54e08fc79f0f52fbce1483ff274f8ba.zip
cmake: Add gdbjit and oprofile options.
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/v8_build.cmake18
2 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d7fc7bf2..4f8e33dfa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,8 @@ option(SHARED_V8 "use system shared V8 library")
option(SHARED_LIBEV "use system shared libev library")
option(SHARED_CARES "use system shared c-ares library")
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_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks
diff --git a/cmake/v8_build.cmake b/cmake/v8_build.cmake
index b35caef2e..b1ae43fe7 100644
--- a/cmake/v8_build.cmake
+++ b/cmake/v8_build.cmake
@@ -14,7 +14,15 @@ endif()
if(NOT SHARED_V8)
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()
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_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)
# use ExternalProject for CMake >2.8
include(ExternalProject)
@@ -48,8 +59,7 @@ if(NOT SHARED_V8)
URL ${PROJECT_SOURCE_DIR}/deps/v8
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
# ignore this stuff, it's not needed for building v8 but ExternalProject
# demands these steps
@@ -79,7 +89,7 @@ if(NOT SHARED_V8)
add_custom_command(
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/
DEPENDS ${v8_sources_dest}
)