[Win CMake] Fix incremental build after r188673
[WebKit-https.git] / Source / JavaScriptCore / PlatformWin.cmake
1 list(APPEND JavaScriptCore_SOURCES
2     API/JSStringRefBSTR.cpp
3     API/JSStringRefCF.cpp
4 )
5
6 if (WTF_PLATFORM_WIN_CAIRO)
7     list(APPEND JavaScriptCore_LIBRARIES
8         CFLite
9     )
10 else ()
11     list(APPEND JavaScriptCore_LIBRARIES
12         CoreFoundation${DEBUG_SUFFIX}
13         ${ICU_LIBRARIES}
14     )
15 endif ()
16
17 if (MSVC AND "${JavaScriptCore_LIBRARY_TYPE}" MATCHES "SHARED")
18     get_property(WTF_LIBRARY_LOCATION TARGET WTF PROPERTY LOCATION)
19
20     add_custom_command(
21         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp
22         DEPENDS WTF
23         COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/Scripts/generate-win32-export-forwards ${WTF_LIBRARY_LOCATION} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp
24         VERBATIM)
25     list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp)
26 endif ()
27
28 list(REMOVE_ITEM JavaScriptCore_SOURCES
29     inspector/JSGlobalObjectInspectorController.cpp
30 )
31
32 file(COPY
33     "${JAVASCRIPTCORE_DIR}/JavaScriptCore.vcxproj/JavaScriptCore.resources"
34     DESTINATION
35     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
36 )
37
38 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore)
39 set(JavaScriptCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/postBuild.cmd")
40 file(WRITE "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
41 file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
42 foreach (_directory ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES})
43     file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${JAVASCRIPTCORE_DIR}/${_directory}/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
44 endforeach ()
45
46 set(JavaScriptCore_OUTPUT_NAME JavaScriptCore${DEBUG_SUFFIX})