Permalink
Browse files

cmake: Add gdbjit and oprofile options.

  • Loading branch information...
1 parent de2686c commit 9d49c93cb54e08fc79f0f52fbce1483ff274f8ba @thughes thughes committed with ry Feb 12, 2011
Showing with 16 additions and 5 deletions.
  1. +2 −1 CMakeLists.txt
  2. +14 −4 cmake/v8_build.cmake
View
@@ -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
View
@@ -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}
)

0 comments on commit 9d49c93

Please sign in to comment.