[CMake] Properly test if compiler supports compiler flags
[WebKit-https.git] / Tools / DumpRenderTree / TestNetscapePlugIn / CMakeLists.txt
1 set(WEBKIT_TESTNETSCAPEPLUGIN_DIR "${TOOLS_DIR}/DumpRenderTree/TestNetscapePlugIn")
2
3 set(WebKitTestNetscapePlugIn_SOURCES
4     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/PluginObject.cpp
5     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/PluginTest.cpp
6     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/TestObject.cpp
7     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/main.cpp
8
9     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/DocumentOpenInDestroyStream.cpp
10     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/EvaluateJSAfterRemovingPluginElement.cpp
11     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/FormValue.cpp
12     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp
13     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetURLWithJavaScriptURL.cpp
14     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp
15     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp
16     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/LogNPPSetWindow.cpp
17     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPDeallocateCalledBeforeNPShutdown.cpp
18     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPPNewFails.cpp
19     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPPSetWindowCalledDuringDestruction.cpp
20     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPRuntimeCallsWithNullNPP.cpp
21     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp
22     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPRuntimeRemoveProperty.cpp
23     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NullNPPGetValuePointer.cpp
24     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PassDifferentNPPStruct.cpp
25     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PluginScriptableNPObjectInvokeDefault.cpp
26     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PluginScriptableObjectOverridesAllProperties.cpp
27     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PrivateBrowsing.cpp
28     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/ToStringAndValueOfObject.cpp
29     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/URLRedirect.cpp
30     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp
31 )
32
33 set(WebKitTestNetscapePlugIn_INCLUDE_DIRECTORIES
34     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}
35     ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/ForwardingHeaders
36     ${WEBCORE_DIR}
37     ${WTF_DIR}
38 )
39
40 set(WebKitTestNetscapePlugIn_SYSTEM_INCLUDE_DIRECTORIES
41     ${X11_INCLUDE_DIR}
42 )
43
44 include_directories(${WebKitTestNetscapePlugIn_INCLUDE_DIRECTORIES})
45 include_directories(SYSTEM ${WebKitTestNetscapePlugIn_SYSTEM_INCLUDE_DIRECTORIES})
46
47 set(WebKitTestNetscapePlugIn_LIBRARIES
48     ${X11_LIBRARIES}
49 )
50
51 if (WTF_OS_UNIX)
52     add_definitions(-DXP_UNIX)
53 endif ()
54
55 add_library(TestNetscapePlugIn SHARED ${WebKitTestNetscapePlugIn_SOURCES})
56 target_link_libraries(TestNetscapePlugIn ${WebKitTestNetscapePlugIn_LIBRARIES})
57 set_target_properties(TestNetscapePlugIn PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins)
58
59 WEBKIT_ADD_TARGET_CXX_FLAGS(TestNetscapePlugIn -Wno-unused-parameter)