Skip to content
Browse files

Add Optimization support

  • Loading branch information...
1 parent 926b597 commit d7b183b5d5ae1609d5268b4e4ab678b9737b1707 @scottmac scottmac committed Feb 23, 2010
Showing with 25 additions and 11 deletions.
  1. +5 −7 CMake/HPHPSetup.cmake
  2. +10 −4 src/CMakeLists.txt
  3. +10 −0 src/lib/CMakeLists.txt
View
12 CMake/HPHPSetup.cmake
@@ -7,14 +7,12 @@ OPTION(REQUEST_TIMEOUT_DETECTION "Enable Timeout Detection" ON)
add_definitions(-D_GNU_SOURCE -D_REENTRANT=1 -D_PTHREADS=1)
-set(CMAKE_C_FLAGS "-w -fPIC")
-set(CMAKE_CXX_FLAGS "-fPIC -fno-omit-frame-pointer -ftemplate-depth-60 -Wall -Woverloaded-virtual -Wno-deprecated -Wno-parentheses -Wno-strict-aliasing -Wno-write-strings ")
-
-IF(0)
- set(HPHP_OPT "-O3")
- add_definitions(-DRELEASE=1)
-ENDIF()
+#should wrap this in an if
+add_definitions(-DRELEASE=1)
+set(HPHP_OPT "-O3")
+set(CMAKE_C_FLAGS "${HPHP_OPT} -w -fPIC")
+set(CMAKE_CXX_FLAGS "${HPHP_OPT} -fPIC -fno-omit-frame-pointer -ftemplate-depth-60 -Wall -Woverloaded-virtual -Wno-deprecated -Wno-parentheses -Wno-strict-aliasing -Wno-write-strings ")
include_directories(${HPHP_HOME}/src)
include_directories(${HPHP_HOME}/src/lib/system/gen)
View
14 src/CMakeLists.txt
@@ -71,8 +71,6 @@ foreach (t ${HPHP_EXCLUDE_FILES})
endif ()
endforeach(t ${HPHP_EXCLUDE_FILES})
-#list(REMOVE_ITEM CXX_SOURCES "${CXX_NOOPT_SOURCES}")
-
FLEX_TARGET(HphpScanner ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/hphp.x ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/lex.eval_.cpp COMPILE_FLAGS " -w -i -Peval_")
BISON_TARGET(HphpParser ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/hphp.y ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/hphp.tab.cpp COMPILE_FLAGS " -v -d -p eval_")
ADD_FLEX_BISON_DEPENDENCY(HphpScanner HphpParser)
@@ -81,8 +79,6 @@ ADD_FLEX_BISON_DEPENDENCY(HphpScanner HphpParser)
list(REMOVE_ITEM CXX_SOURCES ${FLEX_HphpScanner_OUTPUTS} ${BISON_HphpParser_OUTPUTS})
list(APPEND CXX_SOURCES ${FLEX_HphpScanner_OUTPUTS} ${BISON_HphpParser_OUTPUTS})
-#list(APPEND C_SOURCES ${TIMELIB_SOURCES})
-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
@@ -95,6 +91,16 @@ add_subdirectory(third_party/xhp/xhp)
add_subdirectory(third_party/libafdt)
add_subdirectory(third_party/libmbfl)
+foreach (CXX_FILE ${CXX_SOURCES})
+ if(${CXX_FILE} MATCHES ".no.cpp$")
+ SET_SOURCE_FILES_PROPERTIES(
+ ${CXX_FILE}
+ PROPERTIES
+ COMPILE_FLAGS -O0
+ )
+ endif()
+endforeach()
+
ADD_LIBRARY(hphp_runtime_static STATIC ${C_SOURCES} ${CXX_SOURCES})
#ADD_LIBRARY(hphp_runtime SHARED ${C_SOURCES} ${CXX_SOURCES})
SET_TARGET_PROPERTIES(hphp_runtime_static PROPERTIES OUTPUT_NAME "hphp_runtime")
View
10 src/lib/CMakeLists.txt
@@ -44,5 +44,15 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../")
set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_SOURCE_DIR}/bin")
+foreach (CXX_FILE ${CXX_SOURCES})
+ if(${CXX_FILE} MATCHES ".no.cpp$")
+ SET_SOURCE_FILES_PROPERTIES(
+ ${CXX_FILE}
+ PROPERTIES
+ COMPILE_FLAGS -O0
+ )
+ endif()
+endforeach()
+
ADD_LIBRARY(hphp_analysis STATIC ${CXX_SOURCES} ${C_SOURCES})
target_link_libraries(hphp_analysis ${Boost_LIBRARIES})

0 comments on commit d7b183b

Please sign in to comment.
Something went wrong with that request. Please try again.