Skip to content
Snippets Groups Projects
Commit 5f1aece3 authored by Jaswant Panchumarti (Kitware)'s avatar Jaswant Panchumarti (Kitware)
Browse files

Adapt wasm-scene-manager optimization and debug info to CMAKE_BUILD_TYPE

- The mapping from CMAKE_BUILD_TYPE is as follows:

| CMAKE_BUILD_TYPE | OPTIMIZATION | DEBUGINFO | TRANSLATES TO|
| ------ | ------ | ------ | ------ |
| Release|BEST|NONE|`-O3 -g0`|
| MinSizeRel|SMALLEST_WITH_CLOSURE|NONE|`-Oz -g0`|
| RelWithDebInfo|MORE|PROFILE|`-O2 -g2`|
| Debug|NO_OPTIMIZATION|DEBUG_NATIVE|`-O0 -g3`|
parent 7dfbf181
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,19 @@ endif ()
# -----------------------------------------------------------------------------
set(emscripten_optimizations)
set(emscripten_debug_options)
set(vtk_scene_manager_wasm_optimize "NO_OPTIMIZATION")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(vtk_scene_manager_wasm_optimize "BEST")
set(vtk_scene_manager_wasm_debuginfo "NONE")
elseif (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set(vtk_scene_manager_wasm_optimize "SMALLEST_WITH_CLOSURE")
set(vtk_scene_manager_wasm_debuginfo "NONE")
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(vtk_scene_manager_wasm_optimize "MORE")
set(vtk_scene_manager_wasm_debuginfo "PROFILE")
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(vtk_scene_manager_wasm_optimize "NO_OPTIMIZATION")
set(vtk_scene_manager_wasm_debuginfo "DEBUG_NATIVE")
endif ()
set(vtk_scene_manager_wasm_optimize_NO_OPTIMIZATION "-O0")
set(vtk_scene_manager_wasm_optimize_LITTLE "-O1")
set(vtk_scene_manager_wasm_optimize_MORE "-O2")
......@@ -71,7 +83,6 @@ else ()
message (FATAL_ERROR "Unrecognized value for vtk_scene_manager_wasm_optimize=${vtk_scene_manager_wasm_optimize}")
endif ()
set(vtk_scene_manager_wasm_debuginfo "PROFILE")
set(vtk_scene_manager_wasm_debuginfo_NONE "-g0")
set(vtk_scene_manager_wasm_debuginfo_READABLE_JS "-g1")
set(vtk_scene_manager_wasm_debuginfo_PROFILE "-g2")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment