emcc `
    src/KinematicsWebAPI.cpp `
    src/main.cpp `
    src/Robot.cpp `
    src/RobotManager.cpp `
    src/utils.cpp `
    src/math_utils.cpp `
    src/smart_json_wrapper.cpp `
    src/kdl_parser/src/kdl_parser.cpp `
    src/kdl_parser/src/joint.cpp `
    src/kdl_parser/src/link.cpp `
    src/kdl_parser/src/model.cpp `
    src/kdl_parser/src/pose.cpp `
    src/kdl_parser/src/tinystr.cpp `
    src/kdl_parser/src/tinyxml.cpp `
    src/kdl_parser/src/tinyxml2.cpp `
    src/kdl_parser/src/tinyxmlerror.cpp `
    src/kdl_parser/src/tinyxmlparser.cpp `
    src/kdl_parser/src/twist.cpp `
    src/kdl_parser/src/world.cpp `
    -I./inc `
    -I./src/kdl_parser/include `
    -I./KDL/install_wasm/include `
    -I./Eigen3 `
    -I./Eigen3/eigen3 `
    -L./KDL/install_wasm/lib `
    -lorocos-kdl `
    -g4 `  
    -O0 `  
    --source-map-base http://localhost:8000/ `
    -s WASM=1 `
    -s ASSERTIONS=2 `     
    -s SAFE_HEAP=1 `     
    -s STACK_OVERFLOW_CHECK=2 `  
    -s DEMANGLE_SUPPORT=1 `       
    -s GL_DEBUG=1 `               
    -s WASM_ASYNC_COMPILATION=0 `  
    -s ERROR_ON_UNDEFINED_SYMBOLS=0 `
    -s WARN_ON_UNDEFINED_SYMBOLS=1 `
    -s EXCEPTION_CATCHING_ALLOWED=['main'] `
    -s DISABLE_EXCEPTION_CATCHING=0 `
    -fexceptions `                 
    -fwasm-exceptions `            
    -s EXCEPTION_DEBUG=1 `        
    -s EMULATE_FUNCTION_POINTER_CASTS=1 `
    -s EMULATE_FUNCTION_POINTER_CAST_MEMORY_WARNING=0 `
    -s ALLOW_MEMORY_GROWTH=1 `
    -s INITIAL_MEMORY=67108864 `
    -s MAXIMUM_MEMORY=268435456 `
    -s USE_PTHREADS=0 `
    -s MODULARIZE=1 `
    -s EXPORT_NAME='createSmartMathModule' `
    -s EXPORTED_FUNCTIONS='["_init_func","_func","_smart_process_json","_smart_get_function_list","_smart_get_function_info","_smart_test_match","_smart_get_version","_smart_free_string","_malloc","_free","_main"]' `
    -s EXPORTED_RUNTIME_METHODS='["UTF8ToString","stringToUTF8","ccall","cwrap","getValue","setValue","stackSave","stackRestore","stackAlloc","addFunction","removeFunction","FS","PROXYFS","WORKERFS","NODEFS","IDBFS","MEMFS","TTY","allocate","intArrayFromString","AsciiToString","stringToAscii","ALLOC_NORMAL","allocateUTF8","allocateUTF8OnStack"]' `
    -o public/wasm/smart_math.js


    python -m http.server 8080





    emcc `
    src/KinematicsWebAPI.cpp `
    src/main.cpp `
    src/Robot.cpp `
    src/RobotManager.cpp `
    src/utils.cpp `
    src/math_utils.cpp `
    src/smart_json_wrapper.cpp `
    src/kdl_parser/src/kdl_parser.cpp `
    src/kdl_parser/src/joint.cpp `
    src/kdl_parser/src/link.cpp `
    src/kdl_parser/src/model.cpp `
    src/kdl_parser/src/pose.cpp `
    src/kdl_parser/src/tinystr.cpp `
    src/kdl_parser/src/tinyxml.cpp `
    src/kdl_parser/src/tinyxml2.cpp `
    src/kdl_parser/src/tinyxmlerror.cpp `
    src/kdl_parser/src/tinyxmlparser.cpp `
    src/kdl_parser/src/twist.cpp `
    src/kdl_parser/src/world.cpp `
    -I./inc `
    -I./src/kdl_parser/include `
    -I./KDL/install_wasm/include `
    -I./Eigen3 `
    -I./Eigen3/eigen3 `
    -L./KDL/install_wasm/lib `
    -lorocos-kdl `
    -g4 `                          # 最大调试信息
    -O0 `                          # 禁用优化
    --source-map-base http://localhost:8000/ `
    -s WASM=1 `
    -s ASSERTIONS=2 `              # 启用断言
    -s SAFE_HEAP=1 `               # 堆安全检查
    -s STACK_OVERFLOW_CHECK=2 `    # 栈溢出检查
    -s DEMANGLE_SUPPORT=1 `        # 支持 C++ 名称还原
    -s GL_DEBUG=1 `                # OpenGL 调试
    -s WASM_ASYNC_COMPILATION=0 `  # 同步编译，便于调试
    -s ERROR_ON_UNDEFINED_SYMBOLS=0 `
    -s WARN_ON_UNDEFINED_SYMBOLS=1 `
    -s EXCEPTION_CATCHING_ALLOWED=['main'] `
    -s DISABLE_EXCEPTION_CATCHING=0 `
    -fexceptions `                 # 启用异常
    -fwasm-exceptions `            # WASM 异常支持
    -s EXCEPTION_DEBUG=1 `         # 异常调试
    -s EMULATE_FUNCTION_POINTER_CASTS=1 `
    -s EMULATE_FUNCTION_POINTER_CAST_MEMORY_WARNING=0 `
    -s ALLOW_MEMORY_GROWTH=1 `
    -s INITIAL_MEMORY=67108864 `
    -s MAXIMUM_MEMORY=268435456 `
    -s USE_PTHREADS=0 `
    -s MODULARIZE=1 `
    -s EXPORT_NAME='createSmartMathModule' `
    -s EXPORTED_FUNCTIONS='["_init_func","_func","_smart_process_json","_smart_get_function_list","_smart_get_function_info","_smart_test_match","_smart_get_version","_smart_free_string","_malloc","_free","_main"]' `
    -s EXPORTED_RUNTIME_METHODS='["UTF8ToString","stringToUTF8","ccall","cwrap","getValue","setValue","stackSave","stackRestore","stackAlloc","addFunction","removeFunction","FS","PROXYFS","WORKERFS","NODEFS","IDBFS","MEMFS","TTY","allocate","intArrayFromString","AsciiToString","stringToAscii","ALLOC_NORMAL","allocateUTF8","allocateUTF8OnStack"]' `
    -o public/wasm/smart_math.js


    python -m http.server 8080