canvas icon indicating copy to clipboard operation
canvas copied to clipboard

v2 (beta) breaks my iOS HEADER_SEARCH_PATHS

Open chris-praxis opened this issue 1 year ago • 3 comments
trafficstars

ENVIRONMENT macOS Sonoma (14.4.1) Xcode 15.3 NS 8.7.0 @nativescript/ios 8.7.1 @nativescript/canvas 2.0.0-beta.21 @nativescript/canvas-three 2.0.0-beta.21

PROBLEM In "App_Resources/iOS/build.xcconfig" I set HEADER_SEARCH_PATHS (including $(inherited)), which is necessary for my native code. @nativescript/canvas also sets HEADER_SEARCH_PATHS (including $(inherited)) in "node_modules/@nativescript/canvas/platforms/ios/build.xcconfig". I'm guessing this is what causes the problem...

fatal error: 
      'include_path/some_header.hpp' file not found

My native code longer compiles until I manually add headers search paths in Xcode. Setting HEADER_SEARCH_PATHS in "App_Resources/iOS/build.xcconfig" no longer works.

chris-praxis avatar May 09 '24 18:05 chris-praxis

Thank you for reporting, if possible can you submit a small app which reproduces the issue.

triniwiz avatar May 09 '24 18:05 triniwiz

Hi @triniwiz,

Test app download is large due to OpenCV: https://drive.google.com/file/d/19Dixw0ktbKdiwG2NF9EaCJ41pXfZnLMW/view?usp=sharing

The error

ios_header_search_test/App_Resources/iOS/src/OpenCV_test.cpp:1:10: fatal error: 'opencv2/opencv.hpp$
#include <opencv2/opencv.hpp>
         ^~~~~~~~~~~~~~~~~~~~

is caused by adding @nativescript/canvas beta, but I suspect it is more of a build issue. Although my HEADER_SEARCH_PATHS and the one in the plug-in both include $(inherited), my paths are not in the resulting Xcode project.

$ ns plugin
Dependencies:
┌──────────────────────┬────────────────┐
│  Plugin               │  Version        │
│  @nativescript/canvas │  ^2.0.0-beta.21 │
│  @nativescript/core   │  ~8.8.0         │
│  @nativescript/theme  │  ~3.0.2         │
│  nativescript-vue     │  ~2.9.3         │
└──────────────────────┴────────────────┘
Dev Dependencies:
┌────────────────────────────────────┬─────────┐
│  Plugin                             │  Version │
│  @nativescript/ios                  │  8.7.2   │
│  @nativescript/webpack              │  ~5.0.0  │
│  nativescript-vue-template-compiler │  ~2.9.3  │
└────────────────────────────────────┴─────────┘

chris-praxis avatar Jul 12 '24 00:07 chris-praxis

Thanks will check this out

triniwiz avatar Jul 15 '24 01:07 triniwiz