Skip to content

Commit

Permalink
fix bug of missing symbol.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiqurm committed Sep 30, 2024
1 parent d498b62 commit 2c8ef1a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "-D__STDC_FORMAT_MACROS -Wno-deprecated-declarations -Wl,-z,defs ${CMAKE_COVERAGE_FLAGS} ${CMAKE_CXX_FLAGS}") #report unresolved symbols
endif()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fwasm-exceptions -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fwasm-exceptions -fPIC -s USE_PTHREADS=1 -s SHARED_MEMORY=1")
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
Expand Down
3 changes: 1 addition & 2 deletions bmf/c_modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function(module_install)
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/meta/${ARGV0}.info ${BMF_ASSEMBLE_ROOT}/bmf/cpp_modules/Module_${ARGV0}/meta.info
)
endfunction()

if(BMF_ENABLE_FFMPEG)
set(HDRS include/ffmpeg_decoder.h
include/ffmpeg_encoder.h
Expand Down Expand Up @@ -86,7 +85,7 @@ if(BMF_ENABLE_FFMPEG)
bmf_module_sdk
)

set_soname(builtin_modules)
# set_soname(builtin_modules)
mac_update(builtin_modules)


Expand Down
3 changes: 1 addition & 2 deletions bmf/hml/include/hmp/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ namespace hmp {
HMP_STR(HMP_VERSION_MAJOR) \
"." HMP_STR(HMP_VERSION_MINOR) "." HMP_STR(HMP_VERSION_PATCH)
#define HMP_DECLARE_TAG(VAR) extern "C" volatile void *VAR##Tag
// #define HMP_DEFINE_TAG(VAR) HMP_DECLARE_TAG(VAR) = (void*)&(VAR)
#define HMP_DEFINE_TAG(VAR)
#define HMP_DEFINE_TAG(VAR) HMP_DECLARE_TAG(VAR) = (void*)&(VAR)

// use in function to ref VAR and prevent compiler optimize out this tag
#define HMP_IMPORT_TAG(VAR) HMP_DONT_TOUCH(VAR##Tag)
Expand Down
4 changes: 2 additions & 2 deletions bmf/test/c_module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ set_property(TARGET PROPERTY CXX_STANDARD 17)
set(ENV{EMCC_FORCE_STDLIBS} 1)
add_executable(run_copy_module run_copy_module.cc)
set(CMAKE_EXECUTABLE_SUFFIX ".html")
set_target_properties(run_copy_module PROPERTIES LINK_FLAGS "-sMAIN_MODULE=1 --preload-file ${CMAKE_SOURCE_DIR}/big_bunny_10s_30fps.mp4@big_bunny_10s_30fps.mp4 --preload-file ${CMAKE_SOURCE_DIR}/BUILTIN_CONFIG.json@BUILTIN_CONFIG.json --preload-file ${CMAKE_BINARY_DIR}/output/bmf/lib/libbuiltin_modules.so@/lib/libbuiltin_modules.so -sALLOW_MEMORY_GROWTH")
set_target_properties(run_copy_module PROPERTIES LINK_FLAGS "-sMAIN_MODULE=1 --preload-file ${CMAKE_SOURCE_DIR}/big_bunny_10s_30fps.mp4@big_bunny_10s_30fps.mp4 --preload-file ${CMAKE_SOURCE_DIR}/BUILTIN_CONFIG.json@BUILTIN_CONFIG.json --preload-file /home/sam/bmf/libbuiltin_modules.so@/lib/libbuiltin_modules.so -s USE_PTHREADS=1 -s SHARED_MEMORY=1 -s INITIAL_MEMORY=64MB -sALLOW_MEMORY_GROWTH")
# set_target_properties(run_copy_module PROPERTIES LINK_FLAGS "-sMAIN_MODULE=1 --preload-file /home/sam/bmf/big_bunny_10s_30fps.mp4@big_bunny_10s_30fps.mp4 --preload-file /home/sam/bmf/BUILTIN_CONFIG.json@BUILTIN_CONFIG.json -sALLOW_MEMORY_GROWTH")
target_link_libraries(run_copy_module
PRIVATE
engine bmf_module_sdk nlohmann
engine bmf_module_sdk hmp nlohmann
)
# target_link_options(run_copy_module PRIVATE "-sERROR_ON_UNDEFINED_SYMBOLS=0")

Expand Down

0 comments on commit 2c8ef1a

Please sign in to comment.