Skip to content

Commit 94ec549

Browse files
authored
Add rules to build internal code.
Differential Revision: D71713725 Pull Request resolved: #9546
1 parent 31d3545 commit 94ec549

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

extension/apple/CMakeLists.txt

+24-8
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,34 @@ endif()
1818

1919
add_library(extension_apple)
2020

21-
file(GLOB EXPORTED_SOURCES ExecuTorch/Exported/*.m ExecuTorch/Exported/*.mm)
21+
file(GLOB EXPORTED_SOURCES
22+
ExecuTorch/Exported/*.m
23+
ExecuTorch/Exported/*.mm
24+
)
25+
26+
file(GLOB INTERNAL_SOURCES
27+
ExecuTorch/Internal/*.m
28+
ExecuTorch/Internal/*.mm
29+
)
2230

23-
target_sources(extension_apple PRIVATE ${EXPORTED_SOURCES})
31+
target_sources(extension_apple PRIVATE
32+
${EXPORTED_SOURCES}
33+
${INTERNAL_SOURCES}
34+
)
2435

25-
target_include_directories(extension_apple PUBLIC ExecuTorch/Exported)
36+
target_include_directories(extension_apple
37+
PUBLIC ExecuTorch/Exported
38+
PRIVATE ExecuTorch/Internal
39+
)
2640

2741
find_library(FOUNDATION_FRAMEWORK Foundation)
28-
target_link_libraries(
29-
extension_apple PRIVATE executorch ${FOUNDATION_FRAMEWORK}
42+
target_link_libraries(extension_apple
43+
PRIVATE executorch ${FOUNDATION_FRAMEWORK}
3044
)
3145

3246
target_compile_options(extension_apple PUBLIC ${_common_compile_options})
33-
target_compile_options(extension_apple PRIVATE "-fobjc-arc")
34-
target_compile_options(extension_apple PRIVATE "-fno-exceptions")
35-
target_compile_options(extension_apple PRIVATE "-fno-rtti")
47+
target_compile_options(extension_apple PRIVATE
48+
"-fobjc-arc"
49+
"-fno-exceptions"
50+
"-fno-rtti"
51+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
#import <Foundation/Foundation.h>

0 commit comments

Comments
 (0)