Use -O0 or -O2 depending on the cmake build type, default to release builds
@@ -161,7 +161,14 @@ IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
ENDIF ()
ENDIF ()
-SET(CMAKE_C_FLAGS "-O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS} -DH2O_ROOT=\"${CMAKE_INSTALL_PREFIX}\" -DH2O_CONFIG_PATH=\"${CMAKE_INSTALL_SYSCONFDIR}/h2o.conf\"")
+SET(CMAKE_C_FLAGS "-g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS} -DH2O_ROOT=\"${CMAKE_INSTALL_PREFIX}\" -DH2O_CONFIG_PATH=\"${CMAKE_INSTALL_SYSCONFDIR}/h2o.conf\"")
+
+# CMake defaults to a Debug build, whereas H2O defaults to an optimied build
+IF(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE Release)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+SET(CMAKE_C_FLAGS_DEBUG "-O0")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
SET(LIBYAML_SOURCE_FILES
deps/yaml/src/api.c
