[CMake][Win] Conditionally select DLL CRT or static CRT
[WebKit-https.git] / Tools / MiniBrowser / win / CMakeLists.txt
1 set(MiniBrowser_INCLUDE_DIRECTORIES
2     "${FORWARDING_HEADERS_DIR}"
3     "${FORWARDING_HEADERS_DIR}/WebKitLegacy"
4     "${CMAKE_SOURCE_DIR}"
5     "${CMAKE_SOURCE_DIR}/Source"
6 )
7
8 set(MiniBrowser_SOURCES
9     AccessibilityDelegate.cpp
10     DOMDefaultImpl.cpp
11     PageLoadTestClient.cpp
12     PrintWebUIDelegate.cpp
13     ResourceLoadDelegate.cpp
14     WebDownloadDelegate.cpp
15     MiniBrowser.cpp
16     MiniBrowserLib.rc
17     MiniBrowserWebHost.cpp
18     WinMain.cpp
19     stdafx.cpp
20 )
21
22 set(MiniBrowser_LIBRARIES
23     DbgHelp
24     WTF
25     WebKitLegacy
26     WebKitLegacyGUID
27     comctl32
28     comsupp
29     comsuppw
30     shlwapi
31 )
32
33 if (USE_CF)
34     list(APPEND MiniBrowser_LIBRARIES
35         ${COREFOUNDATION_LIBRARY}
36     )
37 endif ()
38
39 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MSVC_RUNTIME_LINKER_FLAGS}")
40 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wWinMainCRTStartup")
41
42 if (${WTF_PLATFORM_WIN_CAIRO})
43     add_definitions(-DWIN_CAIRO)
44 endif ()
45 add_definitions(-D_UNICODE)
46 include_directories(${MiniBrowser_INCLUDE_DIRECTORIES})
47 add_library(MiniBrowserLib SHARED ${MiniBrowser_SOURCES})
48 target_link_libraries(MiniBrowserLib ${MiniBrowser_LIBRARIES})
49
50 add_executable(MiniBrowser WIN32 ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp MiniBrowser.rc)
51 target_link_libraries(MiniBrowser shlwapi)
52 set_target_properties(MiniBrowser PROPERTIES OUTPUT_NAME "MiniBrowser")
53
54 add_dependencies(MiniBrowser MiniBrowserLib)