Skip to content

Commit

Permalink
Adjust build parameters based on @carlodek's suggestion (raulmur/ORB_…
Browse files Browse the repository at this point in the history
  • Loading branch information
nickw1 committed Aug 25, 2022
1 parent b10684c commit 16742f9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ project( orb_wasm )

# Use C++ 11 by default
# Now use C++ 14, I think some of the PTAM code needs it
set( CMAKE_CXX_STANDARD 14 )
# adjusted back to 11 for ORB-SLAM as @carlodek, see below
set( CMAKE_CXX_STANDARD 11 )

set( opencvdir "/home/nick/src/opencv" )
set( orbdir "/home/nick/src/ORB_SLAM3" )
Expand All @@ -25,7 +26,7 @@ include_directories( ${opencv_include_modules} "${orbdir}/include" ${orbdir} ${e
add_compile_options("-pthread")
add_link_options("-pthread")

add_link_options("SHELL: --preload-file assets")
add_compile_options("-O1")
add_compile_options("-gsource-map")
add_compile_options("-fexceptions")
add_compile_options("SHELL: -s USE_ZLIB=1")
Expand All @@ -39,10 +40,18 @@ add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1")
# the below is useful to debug pointer errors but doesn't seem to link properly
# https://emscripten.org/docs/debugging/Sanitizers.html
#add_link_options("-fsanitize=address")
add_link_options("--bind")
# add_link_options("--bind") # replaced by -lembind below
#add_compile_options("-O3")
#add_link_options("-s LLD_REPORT_UNDEFINED")

# from @carlodek https://github.com/raulmur/ORB_SLAM2/issues/264
add_link_options("-O1")
add_link_options("SHELL: -s MAXIMUM_MEMORY=4GB")
add_link_options("SHELL: -s NO_EXIT_RUNTIME=1")
add_link_options("SHELL: --preload-file assets")
add_link_options("--use-preload-plugins")
add_link_options("-lembind")

# Our hello world executable
add_executable( orb_wasm orb_wasm.cpp )

Expand All @@ -51,5 +60,3 @@ file( GLOB opencv_js "${opencvdir}/build_wasm/lib/*.a" )
set( orb_lib "${orbdir}/build/libORB_SLAM3.a" )
#file( GLOB_RECURSE orb_libs_external "${orbdir}/external/*.a" )
target_link_libraries(orb_wasm ${orb_lib} "${orbdir}/Thirdparty/g2o/lib/libg2o.a" "${orbdir}/Thirdparty/DBoW2/lib/libDBoW2.a" ${opencv_js} -lz)
#target_link_libraries(orb_wasm -L${orbdir}/orb -L${orbdir}/external/libcvd -L${orbdir}/external/gvars-3.0 -L${orbdir}/external/clapack-3.2.1/SRC -L${orbdir}/external/clapack-3.2.1/BLAS/SRC -L${orbdir}/external/clapack-3.2.1/F2CLIBS/libf2c -lPTAM -llibcvd -lgvars -llapack -lblas -lf2c)

0 comments on commit 16742f9

Please sign in to comment.