54f0ea01a7cd5a271b05c68580705e649312978a
[platform/framework/web/crosswalk-tizen.git] / src / runtime / CMakeLists.txt
1 # Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 # Package Dependencies
6 IF(X11_SUPPORT)
7   SET(WIN_PKG "ecore-x")
8 ENDIF(X11_SUPPORT)
9 IF(WAYLAND_SUPPORT)
10   SET(WIN_PKG "ecore-wayland")
11 ENDIF(WAYLAND_SUPPORT)
12
13 PKG_CHECK_MODULES(TARGET_RUNTIME_DEPS
14   dlog
15   ${WIN_PKG}
16   elementary
17   capi-appfw-application
18   chromium-efl
19   efl-assist
20   deviced
21   cert-svc
22   REQUIRED
23 )
24
25 # Include Directories
26 SET(TARGET_RUNTIME_INCS
27   ${BASE_SRCDIR}
28   ${TARGET_RUNTIME_DEPS_INCLUDE_DIRS}
29 )
30
31 # Libraries
32 SET(TARGET_RUNTIME_LIBS
33   ${TARGET_RUNTIME_DEPS_LIBRARIES}
34 )
35
36 # Source Files
37 SET(TARGET_RUNTIME_SRCS
38   ${BASE_SRCDIR}/runtime/command_line.cc
39   ${BASE_SRCDIR}/runtime/native_window.cc
40   ${BASE_SRCDIR}/runtime/native_app_window.cc
41   ${BASE_SRCDIR}/runtime/web_application.cc
42   ${BASE_SRCDIR}/runtime/runtime.cc
43   ${BASE_SRCDIR}/runtime/web_view.cc
44   ${BASE_SRCDIR}/runtime/vibration_manager.cc
45 )
46
47 # Compiler Flags
48 SET(TARGET_RUNTIME_CFLAGS
49   "-fPIE"
50 )
51
52 # Linker Flags
53 SET(TARGET_RUNTIME_LDFLAGS
54   "-pie"
55 )
56
57 # Build Executable
58 INCLUDE_DIRECTORIES(${TARGET_RUNTIME_INCS})
59 ADD_DEFINITIONS(${TARGET_RUNTIME_CFLAGS})
60 ADD_EXECUTABLE(${TARGET_RUNTIME} ${TARGET_RUNTIME_SRCS})
61 TARGET_LINK_LIBRARIES(${TARGET_RUNTIME}
62   "-Wl,--whole-archive"
63   ${TARGET_COMMON_STATIC}
64   "-Wl,--no-whole-archive"
65   ${TARGET_RUNTIME_LIBS}
66   ${TARGET_RUNTIME_LDFLAGS}
67 )
68
69 # Install
70 INSTALL(TARGETS ${TARGET_RUNTIME} DESTINATION bin)
71
72 # EDC Build
73 ADD_CUSTOM_COMMAND(
74     OUTPUT ${BASE_SRCDIR}/runtime/wrt.edj
75     COMMAND edje_cc
76     ARGS  ${BASE_SRCDIR}/runtime/wrt.edc
77           ${BASE_SRCDIR}/runtime/wrt.edj
78     DEPENDS ${BASE_SRCDIR}/runtime/wrt.edc
79 )
80 ADD_CUSTOM_TARGET(WRT_EDJE ALL
81     DEPENDS ${BASE_SRCDIR}/runtime/wrt.edj
82 )
83 INSTALL(FILES
84     ${BASE_SRCDIR}/runtime/wrt.edj
85     DESTINATION share/edje/wrt/
86 )