Permalink
Browse files

Add some missing options in cmake and put them in a separate file

The options about infinite loop, infinite recursion and request timeout
detection were defined in the cmake files but not passed to the
compiler. This patch adds them in case they are set to ON.

In addition the patch adds some other options, which are left to OFF by
default (except for ENABLE_LATE_STATIC_BINDING). Finally all the
options are put together in a file Options.cmake.
  • Loading branch information...
1 parent 14e76bd commit f0ba36df9569d81a85a4530f730d8720a4a41739 @lcastelli lcastelli committed with scottmac Feb 3, 2011
Showing with 65 additions and 6 deletions.
  1. +0 −3 CMake/HPHPFindLibs.cmake
  2. +45 −3 CMake/HPHPSetup.cmake
  3. +20 −0 CMake/Options.cmake
@@ -69,8 +69,6 @@ set(CMAKE_REQUIRED_LIBRARIES)
# GD checks
find_package(GD REQUIRED)
-option(WANT_FB_LIBMCC "want FB Memcache" 0)
-
if (WANT_FB_LIBMCC)
add_definitions(-DHPHP_WITH_LIBMCC)
message(FATAL_ERROR Need to add libmcc and libch for linking)
@@ -136,7 +134,6 @@ FIND_LIBRARY(UNWIND_LIB unwind)
# Google tmalloc
add_definitions(-DNO_JEMALLOC=1)
-option(USE_TCMALLOC "Use tcmalloc" ON)
if (USE_TCMALLOC)
FIND_LIBRARY(GOOGLE_TCMALLOC_LIB tcmalloc_minimal)
View
@@ -1,6 +1,4 @@
-OPTION(INFINITE_LOOP_DETECTION "Enable Infinite Loop Detection" ON)
-OPTION(INFINITE_RECURSION_DETECTION "Enable Infinite Recursion Detection" ON)
-OPTION(REQUEST_TIMEOUT_DETECTION "Enable Timeout Detection" ON)
+include(Options)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
@@ -53,6 +51,50 @@ if(${CMAKE_BUILD_TYPE} MATCHES "Release")
add_definitions(-DRELEASE=1)
endif()
+if(INFINITE_LOOP_DETECTION)
+ add_definitions(-DINFINITE_LOOP_DETECTION=1)
+endif()
+
+if(INFINITE_RECURSION_DETECTION)
+ add_definitions(-DINFINITE_RECURSION_DETECTION=1)
+endif()
+
+if(REQUEST_TIMEOUT_DETECTION)
+ add_definitions(-DREQUEST_TIMEOUT_DETECTION=1)
+endif()
+
+if(ENABLE_LATE_STATIC_BINDING)
+ add_definitions(-DENABLE_LATE_STATIC_BINDING=1)
+endif()
+
+if(DEBUG_MEMORY_LEAK)
+ add_definitions(-DDEBUG_MEMORY_LEAK=1)
+endif()
+
+if(DEBUG_APC_LEAK)
+ add_definitions(-DDEBUG_APC_LEAK=1)
+endif()
+
+if(ALWAYS_ASSERT)
+ add_definitions(-DALWAYS_ASSERT=1)
+endif()
+
+if(HOTPROFILER)
+ add_definitions(-DHOTPROFILER=1)
+endif()
+
+if(HOTPROFILER_NO_BUILTIN)
+ add_definitions(-DHOTPROFILER_NO_BUILTIN=1)
+endif()
+
+if(EXECUTION_PROFILER)
+ add_definitions(-DEXECUTION_PROFILER=1)
+endif()
+
+if(ENABLE_FULL_SETLINE)
+ add_definitions(-DENABLE_FULL_SETLINE=1)
+endif()
+
if(APPLE OR FREEBSD)
add_definitions(-DSKIP_USER_CHANGE=1)
endif()
View
@@ -0,0 +1,20 @@
+#set(CMAKE_BUILD_TYPE Debug)
+
+option(ENABLE_LATE_STATIC_BINDING "Enable Late Static Binding" ON)
+
+option(INFINITE_LOOP_DETECTION "Enable Infinite Loop Detection" ON)
+option(INFINITE_RECURSION_DETECTION "Enable Infinite Recursion Detection" ON)
+option(REQUEST_TIMEOUT_DETECTION "Enable Timeout Detection" ON)
+
+option(ALWAYS_ASSERT "Enabled asserts in a release build" OFF)
+option(DEBUG_MEMORY_LEAK "Allow easier debugging of memory leaks" OFF)
+option(DEBUG_APC_LEAK "Allow easier debugging of apc leaks" OFF)
+
+option(HOTPROFILER "Enable support for the hot-profiler" OFF)
+option(HOTPROFILER_NO_BUILTIN "Don't consider builtins for the hot-profiler" OFF)
+option(EXECUTION_PROFILER "Enable the execution profiler" OFF)
+option(ENABLE_FULL_SETLINE "Enable full setline function for debugger and code-coverage" OFF)
+
+option(WANT_FB_LIBMCC "want FB Memcache" OFF)
+
+option(USE_TCMALLOC "Use tcmalloc" ON)

0 comments on commit f0ba36d

Please sign in to comment.