Hermes executor migration to CMake

Summary:
Adds CMake files to configure hermes-executor build, with the same setup as we have in Android.mk

Changelog: [Internal] - CMake build config for hermes executor

Reviewed By: cortinico

Differential Revision: D34811909

fbshipit-source-id: 2df6dbaf46131db87a25e26c83b38ba44f29d1d3
This commit is contained in:
Andrei Shikov
2022-03-16 01:47:05 -07:00
committed by Facebook GitHub Bot
parent a6095d43cd
commit 6c5bd6d790
5 changed files with 104 additions and 3 deletions
@@ -0,0 +1,41 @@
# 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_executor_SRC CONFIGURE_DEPENDS *.cpp)
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
set(HERMES_TARGET_SUFFIX debug)
else()
set(HERMES_TARGET_SUFFIX release)
endif()
set(HERMES_TARGET_NAME hermes-executor-${HERMES_TARGET_SUFFIX})
add_library(
${HERMES_TARGET_NAME}
SHARED
${hermes_executor_SRC}
)
target_compile_options(
${HERMES_TARGET_NAME}
PRIVATE
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1>
-fexceptions
)
target_include_directories(${HERMES_TARGET_NAME} PRIVATE .)
target_link_libraries(
${HERMES_TARGET_NAME}
hermes-executor-common
jsireact
fb
fbjni
folly_json
hermes-engine::libhermes
jsi
reactnativejni
)