annotate Resources/CodeGeneration/testWasmIntegrated/CMakeLists.txt @ 497:d79f78971fae bgo-commands-codegen

Fixed cmake (removed missing useless file)
author bgo-osimis
date Sun, 24 Feb 2019 10:11:38 +0100
parents 8b6ceae45ba0
children baa9e1e932db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
495
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8)
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
2
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
3 project(testWasmIntegratedCpp)
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
4
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
5 set(WASM_FLAGS "-s WASM=1 -O0 -g0")
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
6 set(WASM_MODULE_NAME "testWasmIntegrated" CACHE STRING "Name of the WebAssembly module")
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
7 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WASM_FLAGS}")
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
8 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WASM_FLAGS}")
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
9 #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --js-library ${STONE_SOURCES_DIR}/Platforms/Wasm/WasmWebService.js --js-library ${STONE_SOURCES_DIR}/Platforms/Wasm/WasmDelayedCallExecutor.js --js-library ${STONE_SOURCES_DIR}/Platforms/Wasm/default-library.js -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'")
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
10 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --js-library ${CMAKE_CURRENT_LIST_DIR}/DefaultLibrary.js -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'")
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
11 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXPORT_NAME='\"${WASM_MODULE_NAME}\"' -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=536870912 -s TOTAL_STACK=128000000") # 512MB + resize
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
12
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
13 add_definitions(-DORTHANC_ENABLE_WASM=1)
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
14
495
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
15 set(testWasmIntegratedCpp_Codegen_Deps
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
16 ${CMAKE_CURRENT_LIST_DIR}/testWasmIntegratedCpp_api.yaml
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
17 ${CMAKE_CURRENT_LIST_DIR}/../template.in.h
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
18 ${CMAKE_CURRENT_LIST_DIR}/../template.in.ts
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
19 )
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
20
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
21 add_custom_command(
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
22 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testWasmIntegratedCpp_generated.hpp ${CMAKE_CURRENT_BINARY_DIR}/testWasmIntegratedCpp_generated.ts
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
23 COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/../stonegentool.py -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/testWasmIntegratedCpp_api.yaml
495
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
24 DEPENDS ${testCppHandler_Codegen_Deps}
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
25 )
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
26
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
27 add_executable(testWasmIntegratedCpp main.cpp ${CMAKE_CURRENT_BINARY_DIR}/testWasmIntegratedCpp_generated.hpp ${testCppHandler_Codegen_Deps})
495
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
28
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
29 target_include_directories(testWasmIntegratedCpp PUBLIC ${CMAKE_BINARY_DIR})
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
30
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
31 set_property(TARGET testWasmIntegratedCpp PROPERTY CXX_STANDARD 11)
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
32
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
33