Mercurial > hg > orthanc-stone
annotate Resources/CodeGeneration/testWasmIntegrated/CMakeLists.txt @ 1012:050f01d7951b
Ugly fix for VS2008 (pre-C++11 vector initialization)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 20 Sep 2019 13:59:36 +0200 |
parents | f185cfcb72a0 |
children |
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") |
499 | 6 set(WASM_MODULE_NAME "TestWasmIntegratedModule" CACHE STRING "Name of the WebAssembly module") |
496
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\"]'") |
499 | 11 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORT_NAME='\"${WASM_MODULE_NAME}\"' -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=536870912 -s TOTAL_STACK=128000000") # 512MB + resize |
496
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 |
515
1dbf2d9ed1e4
Added .j2 extension to the Jinja2 template files to allow for a better syntax highlighting experience (a.o. in vscode)
Benjamin Golinvaux <bgo@osimis.io>
parents:
499
diff
changeset
|
17 ${CMAKE_CURRENT_LIST_DIR}/../template.in.h.j2 |
1dbf2d9ed1e4
Added .j2 extension to the Jinja2 template files to allow for a better syntax highlighting experience (a.o. in vscode)
Benjamin Golinvaux <bgo@osimis.io>
parents:
499
diff
changeset
|
18 ${CMAKE_CURRENT_LIST_DIR}/../template.in.ts.j2 |
495
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 |
499 | 21 set(jsoncppRootDir ${CMAKE_CURRENT_LIST_DIR}/jsoncpp-1.8.4) |
22 | |
495
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
23 add_custom_command( |
690 | 24 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/TestStoneCodeGen_generated.hpp ${CMAKE_CURRENT_BINARY_DIR}/TestStoneCodeGen_generated.ts |
687
342f3e04bfa9
CodeGen: test cleanup + all working again + using same yaml and stimuli files
Alain Mazy <alain@mazy.be>
parents:
519
diff
changeset
|
25 COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/../stonegentool.py -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/../test_data/testTestStoneCodeGen.yaml |
342f3e04bfa9
CodeGen: test cleanup + all working again + using same yaml and stimuli files
Alain Mazy <alain@mazy.be>
parents:
519
diff
changeset
|
26 DEPENDS ${testCppHandler_Codegen_Deps} ${CMAKE_CURRENT_LIST_DIR}/../test_data/testTestStoneCodeGen.yaml |
495
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
27 ) |
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
28 |
499 | 29 add_executable(testWasmIntegratedCpp |
30 main.cpp | |
690 | 31 ${CMAKE_CURRENT_BINARY_DIR}/TestStoneCodeGen_generated.hpp |
499 | 32 ${jsoncppRootDir}/jsoncpp.cpp |
33 ${testCppHandler_Codegen_Deps}) | |
495
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
34 |
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
35 target_include_directories(testWasmIntegratedCpp PUBLIC ${CMAKE_BINARY_DIR}) |
499 | 36 target_include_directories(testWasmIntegratedCpp PUBLIC ${jsoncppRootDir}) |
495
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
37 |
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
38 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
|
39 |
6405435480ae
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff
changeset
|
40 |