Skip to content

Commit 6bd9fd7

Browse files
authored
Merge branch 'master' into mac-single-buil
2 parents 5deb80b + e3d3cf4 commit 6bd9fd7

52 files changed

Lines changed: 21176 additions & 11843 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 2
3+
UseTab: Never
4+
ColumnLimit: 0
5+
BinPackArguments: false
6+
BinPackParameters: false
7+
AllowAllArgumentsOnNextLine: false
8+
AllowAllParametersOfDeclarationOnNextLine: false
9+
AlwaysBreakAfterReturnType: None
10+
PenaltyBreakAssignment: 100000000
11+
PenaltyBreakBeforeFirstCallParameter: 100000000
12+
PenaltyBreakComment: 100000000
13+
PenaltyBreakFirstLessLess: 100000000
14+
PenaltyBreakString: 100000000
15+
PenaltyExcessCharacter: 100000000
16+
PenaltyReturnTypeOnItsOwnLine: 100000000
17+
PenaltyIndentedWhitespace: 100000000
18+
ContinuationIndentWidth: 2
19+
AlignAfterOpenBracket: DontAlign
20+
AlignOperands: false
21+
BreakBeforeBinaryOperators: None
22+
BreakBeforeTernaryOperators: false

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77
jobs:
88
create_release:
99
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ name: Test
33
on: [push]
44

55
jobs:
6+
style:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: checkout
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-node@v2
14+
- name: Code Style Check
15+
run: npx -y prettier -c .
16+
# run: npx @biomejs/biome format . # do this after we move to biome config
17+
618
build:
719
strategy:
820
fail-fast: false
@@ -68,4 +80,4 @@ jobs:
6880
path: ./node_modules
6981
key: modules-${{ hashFiles('package-lock.json') }}
7082
- name: Build for arm
71-
run: docker run --platform linux/arm --rm -v "${PWD}:/work" -w /work node ./tools/crossbuild-drm.sh
83+
run: docker run --platform linux/arm --rm -v "${PWD}:/work" -w /work node ./tools/crossbuild-drm.sh

.prettierrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSameLine": false,
4+
"bracketSpacing": true,
5+
"embeddedLanguageFormatting": "auto",
6+
"endOfLine": "lf",
7+
"htmlWhitespaceSensitivity": "css",
8+
"insertPragma": false,
9+
"jsxSingleQuote": true,
10+
"printWidth": 9999,
11+
"proseWrap": "preserve",
12+
"quoteProps": "as-needed",
13+
"requirePragma": false,
14+
"semi": false,
15+
"singleAttributePerLine": false,
16+
"singleQuote": true,
17+
"tabWidth": 2,
18+
"trailingComma": "none",
19+
"useTabs": false,
20+
"vueIndentScriptAndStyle": false
21+
}

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include(FetchContent)
22

3-
cmake_minimum_required(VERSION 3.11)
3+
# 2025-02-15: based on https://github.com/raysan5/raylib/blob/master/src/external/glfw/CMakeLists.txt, make sure the CMake version are between 3.4 and 3.28 or the whole raylib lib will face fatal errors
4+
cmake_minimum_required(VERSION 3.4...3.28 FATAL_ERROR)
45
project (node-raylib
56
VERSION 0.10.0
67
DESCRIPTION "Node.js bindings for raylib"
@@ -11,36 +12,38 @@ if ( CMAKE_COMPILER_IS_GNUCC )
1112
set(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS} -Wno-unused-result")
1213
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
1314
endif()
15+
# 2025-02-15: based on @link: https://learn.microsoft.com/en-us/cpp/build/reference/o-options-optimize-code?view=msvc-170. MSVC only accept O2 and don't have O3 optimization flag
1416
if ( MSVC )
1517
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
18+
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
19+
else()
20+
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
1621
endif()
1722

1823
if(NOT CMAKE_BUILD_TYPE)
1924
set(CMAKE_BUILD_TYPE Release)
2025
endif()
2126

2227
set(CMAKE_CXX_FLAGS_DEBUG "-g")
23-
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
2428

2529
# single build for both Mac arches
2630
set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
2731

2832
# version doesn't seem to pick correct version
29-
#find_package(raylib 4.5 QUIET EXACT)
33+
#find_package(raylib 5.5 QUIET EXACT)
3034
if (NOT raylib_FOUND)
3135
include(FetchContent)
3236
FetchContent_Declare(
3337
raylib
3438
GIT_REPOSITORY https://github.com/raysan5/raylib.git
35-
GIT_TAG 4.5.0
39+
GIT_TAG 5.5
3640
GIT_SHALLOW TRUE
3741
)
3842
FetchContent_GetProperties(raylib)
3943
if (NOT raylib_POPULATED)
4044
set(FETCHCONTENT_QUIET NO)
41-
FetchContent_Populate(raylib)
45+
FetchContent_MakeAvailable(raylib)
4246
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
43-
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
4447
endif()
4548
endif()
4649

@@ -78,7 +81,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
7881
SUFFIX ".node"
7982
)
8083

81-
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
84+
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
8285

8386
target_include_directories(${PROJECT_NAME} PUBLIC
8487
"${CMAKE_JS_INC}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![node-raylib Logo](logo/raylib-node_256x256.png)
22

3-
# node-raylib [![npm version](http://img.shields.io/npm/v/raylib.svg)](https://npmjs.org/package/raylib "View this project on npm") [![Tests](https://github.com/RobLoach/node-raylib/workflows/Tests/badge.svg)](https://github.com/RobLoach/node-raylib/actions?query=workflow%3ATests+branch%3Amaster "See automated test status on GitHub Actions")
3+
# node-raylib [![npm version](http://img.shields.io/npm/v/raylib.svg)](https://npmjs.org/package/raylib "View this project on npm") [![Tests](https://github.com/RobLoach/node-raylib/actions/workflows/test.yml/badge.svg)](https://github.com/RobLoach/node-raylib/actions/workflows/test.yml "See automated test status on GitHub Actions")
44

55
[Node.js](https://nodejs.org) bindings for [raylib](https://www.raylib.com/), a simple and easy-to-use library to enjoy videogames programming (www.raylib.com).
66

0 commit comments

Comments
 (0)