-
Notifications
You must be signed in to change notification settings - Fork 37
/
CMakeLists.txt
104 lines (84 loc) · 2.09 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
cmake_minimum_required(VERSION 2.8)
project(v8eval)
option(V8EVAL_TEST "Build tests" OFF)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0015 NEW)
endif(COMMAND cmake_policy)
include_directories(
v8
v8/include
src
v8/third_party/googletest/src/googletest/include
)
set(v8eval-linkdirs
v8/out.gn/x64.release/obj
v8/out.gn/x64.release/obj/third_party/googletest
)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(v8eval-linkdirs
${v8eval-linkdirs}
v8/out.gn/x64.release/obj/buildtools/third_party/libc++
v8/out.gn/x64.release/obj/buildtools/third_party/libc++abi
)
endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
link_directories(
${v8eval-linkdirs}
)
add_library(v8eval STATIC
src/v8eval.cxx
)
add_library(v8eval_go STATIC
src/v8eval_go.cxx
)
add_library(v8eval_python STATIC
src/v8eval_python.cxx
)
add_library(v8eval_ruby STATIC
src/v8eval_ruby.cxx
)
set(v8eval-cflags
-Wall
-Werror
-Wno-missing-field-initializers
-Wno-unused-parameter
-Wshorten-64-to-32
-fPIC
-fno-exceptions
-fno-rtti
-fno-strict-aliasing
-fno-threadsafe-statics
-fvisibility=hidden
-fvisibility-inlines-hidden
-gdwarf-2
-std=c++14
)
if(APPLE)
set(v8eval-cflags
${v8eval-cflags}
-stdlib=libc++
)
endif(APPLE)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(v8eval-cflags
${v8eval-cflags}
-nostdinc++
-isystem ${CMAKE_CURRENT_SOURCE_DIR}/v8/buildtools/third_party/libc++/trunk/include
-isystem ${CMAKE_CURRENT_SOURCE_DIR}/v8/buildtools/third_party/libc++abi/trunk/include
)
endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
string(REPLACE ";" " " v8eval-cflags "${v8eval-cflags}")
set_target_properties(v8eval PROPERTIES
COMPILE_FLAGS "${v8eval-cflags}"
)
set_target_properties(v8eval_go PROPERTIES
COMPILE_FLAGS "${v8eval-cflags}"
)
set_target_properties(v8eval_python PROPERTIES
COMPILE_FLAGS "${v8eval-cflags}"
)
set_target_properties(v8eval_ruby PROPERTIES
COMPILE_FLAGS "${v8eval-cflags}"
)
if(V8EVAL_TEST)
add_subdirectory(test)
endif(V8EVAL_TEST)