[CMake] Make CODE_GENERATOR_PREPROCESSOR more useable
[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 IF (MSVC)
9     # FIXME: Some codegenerators don't support paths with spaces. So use the executable name only.
10     GET_FILENAME_COMPONENT(CODE_GENERATOR_PREPROCESSOR_EXECUTABLE ${CMAKE_CXX_COMPILER} NAME)
11     SET(CODE_GENERATOR_PREPROCESSOR "${CODE_GENERATOR_PREPROCESSOR_EXECUTABLE} /nologo /EP")
12 ELSE ()
13     SET(CODE_GENERATOR_PREPROCESSOR "${CMAKE_CXX_COMPILER} -E -P -x c++")
14 ENDIF ()
15
16 IF (ENABLE_WEBGL)
17     FIND_PACKAGE(OpenGL REQUIRED)
18 ENDIF ()