Skip to content

Commit

Permalink
EASTL_DLL可以去掉undefined symbol: _ZnamPKcijS0_i
Browse files Browse the repository at this point in the history
chexiongsheng committed Dec 13, 2024
1 parent 3830560 commit 7216582
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -112,6 +112,10 @@ set(qjs_sources
quickjs/quickjs.c
)

set(papi_sources
source/PapiQuickjsImpl.cpp
)

add_definitions(-D_CHAR16T)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
@@ -136,17 +140,20 @@ if(NOT MSVC)
endif()

if ( APPLE AND IOS )
add_library(PapiQjs STATIC ${qjs_sources} ${eastl_sources})
add_library(PapiQjs STATIC ${qjs_sources} ${eastl_sources} ${papi_sources})
else ()
add_library(PapiQjs SHARED ${qjs_sources} ${eastl_sources}) # if add eastl_headers will undefined symbol: __udivti3 __udivmodti4
add_library(PapiQjs SHARED ${qjs_sources} ${eastl_sources} ${papi_sources}) # if add eastl_headers will undefined symbol: __udivti3 __udivmodti4
endif()
target_compile_definitions(PapiQjs PRIVATE ${qjs_defines})
target_include_directories(PapiQjs PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(PapiQjs PUBLIC ${qjs_libs})
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")

target_compile_definitions(PapiQjs PUBLIC EA_DEPRECATIONS_FOR_2024_APRIL=EA_DISABLED)
target_compile_definitions(PapiQjs PUBLIC EA_DEPRECATIONS_FOR_2024_SEPT=EA_DISABLED)
target_compile_definitions(PapiQjs PUBLIC EA_DEPRECATIONS_FOR_2025_APRIL=EA_DISABLED)
target_compile_definitions(PapiQjs PUBLIC EASTL_DLL)

6 changes: 6 additions & 0 deletions source/PapiQuickjsImpl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <EASTL/string.h>

void GetPapiQuickjsImpl()
{
eastl::string str = "hello world";
}

0 comments on commit 7216582

Please sign in to comment.