[CMake] Make USE_CF conditional within Windows
[WebKit-https.git] / Source / WTF / wtf / PlatformWin.cmake
1 list(APPEND WTF_HEADERS
2     cf/TypeCastsCF.h
3 )
4
5 list(APPEND WTF_SOURCES
6     PlatformUserPreferredLanguagesWin.cpp
7
8     text/win/TextBreakIteratorInternalICUWin.cpp
9
10     win/CPUTimeWin.cpp
11     win/MainThreadWin.cpp
12     win/MemoryFootprintWin.cpp
13     win/MemoryPressureHandlerWin.cpp
14     win/RunLoopWin.cpp
15     win/WorkQueueWin.cpp
16 )
17
18 list(APPEND WTF_HEADERS
19     "${DERIVED_SOURCES_WTF_DIR}/AVFoundationHeaderDetection.h"
20 )
21
22 if (USE_CF)
23     list(APPEND WTF_SOURCES
24         text/cf/AtomicStringImplCF.cpp
25         text/cf/StringCF.cpp
26         text/cf/StringImplCF.cpp
27         text/cf/StringViewCF.cpp
28     )
29
30     list(APPEND WTF_LIBRARIES ${COREFOUNDATION_LIBRARY})
31 endif ()
32
33 add_custom_command(
34     OUTPUT "${DERIVED_SOURCES_WTF_DIR}/AVFoundationHeaderDetection.h"
35     WORKING_DIRECTORY "${DERIVED_SOURCES_WTF_DIR}"
36     COMMAND ${PYTHON_EXECUTABLE} ${WTF_DIR}/AVFoundationSupport.py ${WEBKIT_LIBRARIES_DIR} > AVFoundationHeaderDetection.h
37     VERBATIM)
38
39 set(WTF_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WTF/preBuild.cmd")
40 file(WRITE "${WTF_PRE_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${WTF_DIR}/wtf/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF\" >nul 2>nul\n@xcopy /y /s /d /f \"${DERIVED_SOURCES_DIR}/WTF/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF\" >nul 2>nul\n")
41 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF)
42
43 set(WTF_OUTPUT_NAME WTF${DEBUG_SUFFIX})