Generate CMakeLists.txt for codegen modules
Summary: Generates `CMakeLists.txt` for the codegen the same way as we generate Android.mk Changelog: [Internal] - CMakeLists.txt for codegen targets Reviewed By: cortinico Differential Revision: D34821864 fbshipit-source-id: 0cbe7a450a4a064e2285890253ae152fb03267c2
This commit is contained in:
Родитель
bbeb50e8b7
Коммит
062a6169ce
|
@ -103,6 +103,56 @@ include $(BUILD_SHARED_LIBRARY)
|
|||
`;
|
||||
};
|
||||
|
||||
// Note: this CMakeLists.txt template includes dependencies for both NativeModule and components.
|
||||
const CMakeListsTemplate = ({
|
||||
libraryName,
|
||||
}: $ReadOnly<{libraryName: string}>) => {
|
||||
return `# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/${libraryName}/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_${libraryName}
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_${libraryName} PUBLIC . react/renderer/components/${libraryName})
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_${libraryName}
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
${libraryName !== 'rncore' ? 'react_codegen_rncore' : ''}
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_${libraryName}
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\"ReactNative\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
`;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
generate(
|
||||
libraryName: string,
|
||||
|
@ -136,6 +186,7 @@ module.exports = {
|
|||
libraryName: libraryName,
|
||||
}),
|
||||
],
|
||||
['jni/CMakeLists.txt', CMakeListsTemplate({libraryName: libraryName})],
|
||||
]);
|
||||
},
|
||||
};
|
||||
|
|
|
@ -60,6 +60,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/SampleWithUppercaseName/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_SampleWithUppercaseName
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_SampleWithUppercaseName PUBLIC . react/renderer/components/SampleWithUppercaseName)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_SampleWithUppercaseName
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_SampleWithUppercaseName
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
@ -124,6 +168,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/complex_objects/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_complex_objects
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_complex_objects PUBLIC . react/renderer/components/complex_objects)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_complex_objects
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_complex_objects
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
@ -188,6 +276,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/empty_native_modules/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_empty_native_modules
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_empty_native_modules PUBLIC . react/renderer/components/empty_native_modules)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_empty_native_modules
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_empty_native_modules
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
@ -252,6 +384,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/native_modules_with_type_aliases/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_native_modules_with_type_aliases
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_native_modules_with_type_aliases PUBLIC . react/renderer/components/native_modules_with_type_aliases)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_native_modules_with_type_aliases
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_native_modules_with_type_aliases
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
@ -324,6 +500,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/real_module_example/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_real_module_example
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_real_module_example PUBLIC . react/renderer/components/real_module_example)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_real_module_example
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_real_module_example
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
@ -388,6 +608,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/simple_native_modules/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_simple_native_modules
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_simple_native_modules PUBLIC . react/renderer/components/simple_native_modules)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_simple_native_modules
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_simple_native_modules
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
@ -460,6 +724,50 @@ LOCAL_CFLAGS := \\\\
|
|||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
",
|
||||
"jni/CMakeLists.txt" => "# 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 react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/two_modules_different_files/*.cpp)
|
||||
|
||||
add_library(
|
||||
react_codegen_two_modules_different_files
|
||||
SHARED
|
||||
\${react_codegen_SRCS}
|
||||
)
|
||||
|
||||
target_include_directories(react_codegen_two_modules_different_files PUBLIC . react/renderer/components/two_modules_different_files)
|
||||
|
||||
target_link_libraries(
|
||||
react_codegen_two_modules_different_files
|
||||
fbjni
|
||||
folly_runtime
|
||||
glog
|
||||
react_codegen_rncore
|
||||
react_debug
|
||||
react_nativemodule_core
|
||||
react_render_core
|
||||
react_render_debug
|
||||
react_render_graphics
|
||||
rrc_view
|
||||
turbomodulejsijni
|
||||
yoga
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
react_codegen_two_modules_different_files
|
||||
PRIVATE
|
||||
-DLOG_TAG=\\\\\\"ReactNative\\\\\\"
|
||||
-fexceptions
|
||||
-frtti
|
||||
-std=c++17
|
||||
-Wall
|
||||
)
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
|
Загрузка…
Ссылка в новой задаче