diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-10 20:57:58 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-11 10:33:44 +0300 |
commit | 75d4048a29bc4b8e344b6a9efc87632b5429376d (patch) | |
tree | b13867e50a2e4668a2f72eb8af7b6abb81ffe846 /cmake | |
parent | 0c6dba8f42054410c456d87db78a624bfe4ccb36 (diff) |
Add CMake helper function em_validate_asmjs_after_build() that adds an extra post-build step to project to confirm that the build output is valid asm.js.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Platform/Emscripten.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/Platform/Emscripten.cmake b/cmake/Platform/Emscripten.cmake index 9bfa829d..ec3f5383 100644 --- a/cmake/Platform/Emscripten.cmake +++ b/cmake/Platform/Emscripten.cmake @@ -135,3 +135,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "Emscripten-over set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "-O2" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_RELEASE") set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "-O2" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL") set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO") + +function(em_validate_asmjs_after_build target) + add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo Validating build output for asm.js... COMMAND "python" ARGS "${EMSCRIPTEN_ROOT_PATH}/tools/validate_asmjs.py" "$<TARGET_FILE:${target}>") +endfunction() |