Commit faf83e24 authored by paroga@webkit.org's avatar paroga@webkit.org

Do not set CMAKE_BUILD_TYPE if it is not defined

https://bugs.webkit.org/show_bug.cgi?id=114243

Reviewed by Geoffrey Garen.

Setting the CMAKE_BUILD_TYPE causes some problem with Visual Studio.
Adopt the current usage of the variable to better CMake style.

* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsEfl.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ddc26fae
cmake_minimum_required(VERSION 2.8.3)
project(WebKit)
# Set a default build type if and only if user did not define one as command
# line options and he did not give custom CFLAGS or CXXFLAGS. Otherwise, flags
# from default build type would overwrite user-defined ones.
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS AND NOT CMAKE_CXX_FLAGS)
set(CMAKE_BUILD_TYPE Release)
endif ()
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
# -----------------------------------------------------------------------------
# Default library type
# -----------------------------------------------------------------------------
......
2013-04-09 Patrick Gansterer <paroga@webkit.org>
Do not set CMAKE_BUILD_TYPE if it is not defined
https://bugs.webkit.org/show_bug.cgi?id=114243
Reviewed by Geoffrey Garen.
Setting the CMAKE_BUILD_TYPE causes some problem with Visual Studio.
Adopt the current usage of the variable to better CMake style.
* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsEfl.cmake:
2013-03-31 Martin Robinson <mrobinson@igalia.com>
Bug 110293 uses read -d which is a non-portable bashism
......
......@@ -25,10 +25,10 @@ endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)" AND "${CMAKE_BUILD_TYPE}" STREQUAL "debug")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)")
# To avoid out of memory when building with debug option in 32bit system.
# See https://bugs.webkit.org/show_bug.cgi?id=77327
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-keep-memory ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "-Wl,--no-keep-memory ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
endif ()
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
......
......@@ -9,7 +9,7 @@ if (NOT DEFINED ENABLE_WEBKIT2)
set(ENABLE_WEBKIT2 ON)
endif ()
if (${CMAKE_BUILD_TYPE} STREQUAL "debug" AND NOT SHARED_CORE)
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND NOT SHARED_CORE)
message(FATAL_ERROR "Turn on the SHARED_CORE flag to make a debug build - e.g.\n build-webkit --efl --debug --cmakeargs=\"-DSHARED_CORE=ON\".\n")
endif ()
......@@ -245,10 +245,10 @@ endif ()
set(CPACK_SOURCE_GENERATOR TBZ2)
# Optimize binary size for release builds by removing dead sections on unix/gcc
if (CMAKE_BUILD_TYPE STREQUAL release AND CMAKE_COMPILER_IS_GNUCC AND UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "-ffunction-sections -fdata-sections ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-ffunction-sections -fdata-sections ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--gc-sections ${CMAKE_SHARED_LINKER_FLAGS}")
if (CMAKE_COMPILER_IS_GNUCC AND UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS_RELEASE "-ffunction-sections -fdata-sections ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "-ffunction-sections -fdata-sections ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,--gc-sections ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
endif ()
if (ENABLE_WEBGL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment