Skip to content

Commit

Permalink
Updated cmake config to read arch from NODE_ARCH (realm#4612)
Browse files Browse the repository at this point in the history
* Updated cmake config to read arch from NODE_ARCH

* Reacted to review

* Removed the debugging message
  • Loading branch information
kraenhansen authored Jun 3, 2022
1 parent 3faa63a commit b63a2c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const Person = {
* Upgraded Realm Core from v12.0.0 to v12.1.0.
* Fix for updated FLX sync error message. ([#4611](https://github.com/realm/realm-js/pull/4611))
* Updated build script to use Xcode 13.1 to match latest Apple App Store compatibility. ([#4605](https://github.com/realm/realm-js/issues/4605))
* Updated the CMake config to read Node arch from `NODE_ARCH` injected by cmake-js instead of injecting our own environment variable.
* <Either mention core version or upgrade>
* <Using Realm Core vX.Y.Z>
* <Upgraded Realm Core from vX.Y.Z to vA.B.C>

10.18.0 Release notes (2022-5-29)
=============================================================
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ if(DEFINED CMAKE_JS_VERSION)
endif()
elseif(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
if(DEFINED ENV{NODE_ARCH_ARM})
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "")
endif()
if(NODE_ARCH STREQUAL "arm64")
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "")
endif()
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
add_link_options(-fuse-ld=gold)
add_link_options(-Wl,-z,noexecstack)
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"build": "npm run build-changes",
"build:arm": "npm run build-changes:arm",
"build-changes": "cmake-js build --debug",
"build-changes:arm": "NODE_ARCH_ARM=1 cmake-js build --debug",
"build-changes:x64": "cmake-js build --debug --arch x64",
"build-changes:arm": "cmake-js build --debug --arch arm64",
"rebuild-changes": "cmake-js rebuild --debug && cd tests && npm install",
"license-check": "npm install && license-checker --exclude \"MIT,ISC,BSD,Apache-2.0,BSD-2-Clause,BSD-3-Clause,WTFPL,Unlicense,(MIT AND CC-BY-3.0)\" | node scripts/handle-license-check.js",
"jsdoc:clean": "rimraf ./docs/output",
Expand Down Expand Up @@ -160,4 +161,4 @@
4
]
}
}
}

0 comments on commit b63a2c0

Please sign in to comment.