forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMakeLists to build C++ files in OSS (facebook#37969)
Summary: Pull Request resolved: facebook#37969 Add CMakeLists to build Bridgeless C++ files in OSS Changelog: [Internal] Reviewed By: cortinico Differential Revision: D46527523 fbshipit-source-id: 93427732461f8efdeff671bff86557ecde5eea47
- Loading branch information
1 parent
739c084
commit 28c26dc
Showing
13 changed files
with
183 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
file(GLOB_RECURSE hermes_instance_jni_SRC CONFIGURE_DEPENDS *.cpp) | ||
|
||
add_library(hermesinstancejni | ||
SHARED | ||
${hermes_instance_jni_SRC} | ||
) | ||
target_compile_options( | ||
hermesinstancejni | ||
PRIVATE | ||
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1> | ||
-std=c++17 | ||
-fexceptions | ||
) | ||
target_include_directories(hermesinstancejni PRIVATE .) | ||
target_link_libraries( | ||
hermesinstancejni | ||
hermes-engine::libhermes | ||
rninstance | ||
fbjni | ||
bridgelesshermes | ||
) |
31 changes: 31 additions & 0 deletions
31
packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
file(GLOB_RECURSE bridgeless_jni_SRC CONFIGURE_DEPENDS *.cpp) | ||
|
||
add_library(rninstance | ||
SHARED | ||
${bridgeless_jni_SRC} | ||
) | ||
target_compile_options( | ||
rninstance | ||
PRIVATE | ||
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1> | ||
-std=c++17 | ||
-fexceptions | ||
) | ||
target_include_directories(rninstance PUBLIC .) | ||
target_link_libraries( | ||
rninstance | ||
fabricjni | ||
turbomodulejsijni | ||
fb | ||
jsi | ||
fbjni | ||
bridgeless | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/react-native/ReactCommon/jserrorhandler/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
add_compile_options(-std=c++17) | ||
|
||
file(GLOB_RECURSE js_error_handler_SRC CONFIGURE_DEPENDS *.cpp) | ||
add_library( | ||
jserrorhandler | ||
SHARED | ||
${js_error_handler_SRC} | ||
) | ||
target_include_directories(jserrorhandler PUBLIC .) | ||
target_link_libraries(jserrorhandler | ||
jsi | ||
folly_runtime | ||
mapbufferjni | ||
) |
37 changes: 37 additions & 0 deletions
37
packages/react-native/ReactCommon/react/bridgeless/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
file(GLOB bridgeless_SRC "*.cpp") | ||
|
||
add_library(bridgeless | ||
STATIC | ||
${bridgeless_SRC} | ||
) | ||
target_compile_options( | ||
bridgeless | ||
PRIVATE | ||
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1> | ||
-std=c++17 | ||
-fexceptions | ||
) | ||
target_include_directories(bridgeless PUBLIC .) | ||
|
||
find_library(LIBHERMES NAMES hermes-engine::libhermes) | ||
if (LIBHERMES) | ||
target_link_libraries(bridgeless hermes-engine::libhermes) | ||
endif () | ||
|
||
target_link_libraries( | ||
bridgeless | ||
jserrorhandler | ||
fabricjni | ||
turbomodulejsijni | ||
fb | ||
jsi | ||
jsireact | ||
) |
25 changes: 25 additions & 0 deletions
25
packages/react-native/ReactCommon/react/bridgeless/hermes/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
add_compile_options(-std=c++17) | ||
|
||
file(GLOB_RECURSE bridgeless_hermes_SRC CONFIGURE_DEPENDS *.cpp) | ||
add_library( | ||
bridgelesshermes | ||
STATIC | ||
${bridgeless_hermes_SRC} | ||
) | ||
target_include_directories(bridgelesshermes PUBLIC .) | ||
|
||
target_link_libraries(bridgelesshermes | ||
jsireact | ||
hermes-engine::libhermes | ||
hermes_inspector | ||
jsi | ||
hermes_executor_common | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,5 @@ target_link_libraries(rrc_native | |
react_render_core | ||
react_render_debug | ||
react_utils | ||
callinvoker | ||
) |