This commit is contained in:
blueloveTH 2023-07-09 03:27:47 +08:00
parent 1b978b5d01
commit 3201d83377
4 changed files with 28 additions and 27 deletions

View File

@ -61,11 +61,6 @@ jobs:
path: output path: output
- name: Benchmark - name: Benchmark
run: python3 scripts/run_tests.py benchmark run: python3 scripts/run_tests.py benchmark
- name: GCC Build Test
run: |
SRC=$(find src/ -name "*.cpp")
g++ -o main --std=c++17 src/main.cpp $SRC
python3 scripts/run_tests.py
- name: C Binding Test - name: C Binding Test
run: bash run_c_binding_test.sh run: bash run_c_binding_test.sh
build_macos: build_macos:
@ -112,22 +107,3 @@ jobs:
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
path: plugins/flutter/example/build/app/outputs/flutter-apk/output path: plugins/flutter/example/build/app/outputs/flutter-apk/output
# build_web:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Setup emsdk
# uses: mymindstorm/setup-emsdk@v12
# with:
# version: 3.1.25
# actions-cache-folder: 'emsdk-cache'
# - name: Verify emsdk
# run: emcc -v
# - name: Compile
# run: |
# mkdir -p output/web/lib
# python3 build.py web
# cp web/lib/* output/web/lib
# - uses: actions/upload-artifact@v3
# with:
# path: output

View File

@ -12,3 +12,8 @@
#define PK_INLINE_EXPORT PK_EXPORT inline #define PK_INLINE_EXPORT PK_EXPORT inline
#endif #endif
#ifdef PK_SHARED_MODULE
#undef PK_EXPORT
#define PK_EXPORT
#endif

View File

@ -4,9 +4,18 @@ project(test)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR- /EHsc /utf-8 /O2")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fexceptions -O2")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif() endif()
endif()
if (MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /FORCE:UNRESOLVED")
endif()
include_directories( include_directories(
${CMAKE_CURRENT_LIST_DIR}/../../include ${CMAKE_CURRENT_LIST_DIR}/../../include

View File

@ -1,3 +1,4 @@
#define PK_SHARED_MODULE
#include "pocketpy.h" #include "pocketpy.h"
using namespace pkpy; using namespace pkpy;
@ -15,4 +16,14 @@ extern "C" {
return mod; return mod;
} }
#if _WIN32
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpvReserved ) // reserved
{
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
#endif
} }