[CMake] Do not pass -P to the preprocessor when running make_names.pl.
[WebKit-https.git] / Source / cmake / OptionsCommon.cmake
1 ADD_DEFINITIONS(-DBUILDING_WITH_CMAKE=1)
2 ADD_DEFINITIONS(-DHAVE_CONFIG_H=1)
3
4 IF (WTF_OS_UNIX)
5     ADD_DEFINITIONS(-DXP_UNIX)
6 ENDIF (WTF_OS_UNIX)
7
8 # CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS only matters with GCC >= 4.7.0.  Since this
9 # version, -P does not output empty lines, which currently breaks make_names.pl in
10 # WebCore. Investigating whether make_names.pl should be changed instead is left as an exercise to
11 # the reader.
12 IF (MSVC)
13     # FIXME: Some codegenerators don't support paths with spaces. So use the executable name only.
14     GET_FILENAME_COMPONENT(CODE_GENERATOR_PREPROCESSOR_EXECUTABLE ${CMAKE_CXX_COMPILER} NAME)
15     SET(CODE_GENERATOR_PREPROCESSOR "${CODE_GENERATOR_PREPROCESSOR_EXECUTABLE} /nologo /EP")
16     SET(CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS "${CODE_GENERATOR_PREPROCESSOR}")
17 ELSEIF (CMAKE_SYSTEM_NAME MATCHES QNX)
18     SET(CODE_GENERATOR_PREPROCESSOR "${CMAKE_CXX_COMPILER} -E -Wp,-P -x c++")
19     SET(CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS "${CODE_GENERATOR_PREPROCESSOR}")
20 ELSE ()
21     SET(CODE_GENERATOR_PREPROCESSOR "${CMAKE_CXX_COMPILER} -E -P -x c++")
22     SET(CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS "${CMAKE_CXX_COMPILER} -E -x c++")
23 ENDIF ()
24
25 SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
26
27 SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
28
29 SET(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Where to install libraries (lib${LIB_SUFFIX})")