[CMake] Make USE_CF conditional within Windows
[WebKit-https.git] / Source / JavaScriptCore / PlatformWin.cmake
1 list(APPEND JavaScriptCore_SOURCES
2     API/JSStringRefBSTR.cpp
3 )
4
5 list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
6     ${CMAKE_BINARY_DIR}/../include/private
7 )
8
9 if (USE_CF)
10     list(APPEND JavaScriptCore_SOURCES
11         API/JSStringRefCF.cpp
12     )
13
14     list(APPEND JavaScriptCore_LIBRARIES
15         ${COREFOUNDATION_LIBRARY}
16     )
17 endif ()
18
19 if (NOT WTF_PLATFORM_WIN_CAIRO)
20     list(APPEND JavaScriptCore_LIBRARIES
21         ${ICU_LIBRARIES}
22         winmm
23     )
24 endif ()
25
26 list(REMOVE_ITEM JavaScriptCore_SOURCES
27     inspector/JSGlobalObjectInspectorController.cpp
28 )
29
30 file(COPY
31     "${JAVASCRIPTCORE_DIR}/JavaScriptCore.vcxproj/JavaScriptCore.resources"
32     DESTINATION
33     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
34 )
35
36 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/JavaScriptCore)
37
38 set(JavaScriptCore_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/preBuild.cmd")
39 file(REMOVE "${JavaScriptCore_PRE_BUILD_COMMAND}")
40 foreach (_directory ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES})
41     file(APPEND "${JavaScriptCore_PRE_BUILD_COMMAND}" "@xcopy /y /d /f \"${JAVASCRIPTCORE_DIR}/${_directory}/*.h\" \"${FORWARDING_HEADERS_DIR}/JavaScriptCore\" >nul 2>nul\n")
42 endforeach ()
43
44 set(JavaScriptCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/postBuild.cmd")
45 file(WRITE "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/*.h\" \"${FORWARDING_HEADERS_DIR}/JavaScriptCore\" >nul 2>nul\n")
46 file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector/*.h\" \"${FORWARDING_HEADERS_DIR}/JavaScriptCore\" >nul 2>nul\n")
47
48 set(JavaScriptCore_OUTPUT_NAME JavaScriptCore${DEBUG_SUFFIX})