File tree 3 files changed +18
-7
lines changed
3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
1
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
2
2
3
- add_executable (hello hello.c)
4
- target_include_directories (hello PRIVATE ${V8_INCLUDE} )
5
- target_link_libraries (hello ${V8_LIBS} wasm_v8 pthread)
6
3
configure_file (${V8V8} /out.gn/x64.release/natives_blob.bin
7
4
${CMAKE_CURRENT_BINARY_DIR} /natives_blob.bin
8
5
COPYONLY )
9
6
configure_file (${V8V8} /out.gn/x64.release/snapshot_blob.bin
10
7
${CMAKE_CURRENT_BINARY_DIR} /snapshot_blob.bin
11
8
COPYONLY )
9
+
10
+ function (example name source )
11
+ add_executable (${name} ${source} )
12
+ target_include_directories (${name} PRIVATE ${V8_INCLUDE} )
13
+ target_link_libraries (${name} ${V8_LIBS} wasm_v8 pthread)
14
+ endfunction (example)
15
+
16
+ example(callback callback.c)
17
+ example(hello hello.c)
18
+ example(trap trap.c)
19
+
20
+ example(callback_cpp callback.cc)
21
+ example(hello_cpp hello.cc)
22
+ example(trap_cpp trap.cc)
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ own wasm_store_t* wasm_store_new(wasm_engine_t*);
145
145
///////////////////////////////////////////////////////////////////////////////
146
146
// Type Representations
147
147
148
- // Tyoe atributes
148
+ // Type attributes
149
149
150
150
typedef enum wasm_mutability_t {
151
151
WASM_CONST ,
Original file line number Diff line number Diff line change 1
- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
1
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fPIC " )
2
2
3
- add_library (wasm_v8 STATIC wasm-v8-lowlevel .cc wasm-bin .cc wasm-v8.cc wasm-bin.hh wasm-v8-lowlevel .hh)
3
+ add_library (wasm_v8 SHARED wasm-bin .cc wasm-c .cc wasm-v8.cc wasm-bin.hh)
4
4
target_include_directories (wasm_v8 PRIVATE ${V8_INCLUDE} ${V8V8} /out.gn/x64.release/gen ${V8V8} /src)
5
5
target_link_libraries (wasm_v8 ${V8_LIBS} )
You can’t perform that action at this time.
0 commit comments