Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run macos CI with V8_ENABLE_SANDBOX option #199

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -8,18 +8,20 @@ jobs:
build_type: [ Release ]
shared_lib: [ false, true ]
header_only: [ false, true ]
v8_compress_pointers: [ false, true ]
exclude:
include:
- os: ubuntu-latest
v8_compress_pointers: true
- os: macos-latest
v8_compress_pointers: false
v8_enable_sandbox: false
- os: macos-latest
v8_compress_pointers: true
v8_enable_sandbox: true
- os: windows-latest
v8_compress_pointers: false
v8_compress_pointers: true
v8_enable_sandbox: false

runs-on: ${{matrix.os}}

name: '${{matrix.os}} ${{matrix.build_type}} shared_lib=${{matrix.shared_lib}} header_only=${{matrix.header_only}} v8_compress_pointers=${{matrix.v8_compress_pointers}}'
name: '${{matrix.os}} ${{matrix.build_type}} shared_lib=${{matrix.shared_lib}} header_only=${{matrix.header_only}} v8_compress_pointers=${{matrix.v8_compress_pointers}} v8_enable_sandbox=${{matrix.v8_enable_sandbox}}'

steps:
- uses: actions/checkout@v2
@@ -47,7 +49,7 @@ jobs:
uses: seanmiddleditch/gha-setup-ninja@v3

- name: Configure CMake
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_TESTING=TRUE -DBUILD_SHARED_LIBS=${{matrix.shared_lib}} -DV8PP_HEADER_ONLY=${{matrix.header_only}} -DV8_COMPRESS_POINTERS=${{matrix.v8_compress_pointers}}
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_TESTING=TRUE -DBUILD_SHARED_LIBS=${{matrix.shared_lib}} -DV8PP_HEADER_ONLY=${{matrix.header_only}} -DV8_COMPRESS_POINTERS=${{matrix.v8_compress_pointers}} -DV8_ENABLE_SANDBOX=${{matrix.v8_enable_sandbox}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ set(V8PP_ISOLATE_DATA_SLOT 0 CACHE STRING "v8::Isolate data slot number, used in
set(V8PP_PLUGIN_INIT_PROC_NAME "v8pp_module_init" CACHE STRING "v8pp plugin initialization procedure name")
set(V8PP_PLUGIN_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX} CACHE STRING "v8pp plugin filename suffix")
set(V8_COMPRESS_POINTERS 1 CACHE BOOL "Use new V8 ABI with V8_COMPRESS_POINTERS and V8_31BIT_SMIS_ON_64BIT_ARCH")
set(V8_ENABLE_SANDBOX 0 CACHE BOOL "Enable sandoxing in V8")

if(BUILD_SHARED_LIBS AND WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true)
6 changes: 5 additions & 1 deletion v8pp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -12,7 +12,11 @@ endif()
configure_file(config.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/config.hpp)

if(V8_COMPRESS_POINTERS)
set(V8PP_DEFINES V8_COMPRESS_POINTERS V8_31BIT_SMIS_ON_64BIT_ARCH)
list(APPEND V8PP_DEFINES V8_COMPRESS_POINTERS V8_31BIT_SMIS_ON_64BIT_ARCH)
endif()

if (V8_ENABLE_SANDBOX)
list(APPEND V8PP_DEFINES V8_ENABLE_SANDBOX)
endif()

set(V8PP_HEADERS
3 changes: 3 additions & 0 deletions v8pp/version.ipp
Original file line number Diff line number Diff line change
@@ -41,6 +41,9 @@ V8PP_IMPL char const* build_options()
#endif
#ifdef V8_COMPRESS_POINTERS
STR(V8_COMPRESS_POINTERS)
#endif
#ifdef V8_ENABLE_SANDBOX
STR(V8_ENABLE_SANDBOX)
#endif
;
#undef STR