ninja

在WIN10上不用CMake和MinGW编译Android版本的OpenCV

青春壹個敷衍的年華 提交于 2020-03-23 23:26:29
3 月,跳不动了?>>> 构建编译项目 不需要安装CMake,MinGW等额外工具。只需要Android NDK和OpenCV源码 。 在WIN10上使用cmd窗口命令编译OpenCV步骤,操作版本为4.0.1: 在OpenCV根目录下面新建一个文件夹,比如叫做build_cmd。因为OpenCV要求 CMAKE_BINARY_DIR 不和 CMAKE_SOURCE_DIR 是同一个文件夹,所以不能在根目录下直接执行cmake cd到build_cmd 执行如下命令,路径对应修改 E:\Android\Sdk\cmake\3.10.2.4988404\bin\cmake.exe ^ -DCMAKE_TOOLCHAIN_FILE=E:\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake ^ -DANDROID_NDK=E:\Android\Sdk\ndk-bundle ^ -DANDROID_ABI="arm64-v8a" ^ -DANDROID_SDK=E:\Android\Sdk ^ -DWITH_TBB=ON ^ -DCPU_BASELINE=NEON ^ -DCPU_DISPATCH=NEON ^ -DOPENCV_ENABLE_NONFREE=ON ^ -DBUILD_ANDROID_EXAMPLES=OFF

Using an ExternalProject download step with Ninja

放肆的年华 提交于 2020-03-21 19:16:52
问题 This seems to be a common problem without a clear answer. The situation is: we have a 3rd party dependency that we want to install at build time when building a target that depends on it. That's roughly: ExternalProject_Add(target-ep DOWNLOAD_COMMAND <whatever> BUILD_COMMAND "" INSTALL_COMMAND "" CONFIGURE_COMMAND "") add_library(target-imp STATIC IMPORTED) set_target_properties(target-imp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES /path/to/install/include IMPORTED_LOCATION /path/to/install/lib

在WIN10上不用CMake和MinGW编译Android版本的OpenCV

て烟熏妆下的殇ゞ 提交于 2020-03-21 00:42:54
3 月,跳不动了?>>> 构建编译项目 不需要安装CMake,MinGW等额外工具。只需要Android NDK和OpenCV源码 。 在WIN10上使用cmd窗口命令编译OpenCV步骤,操作版本为4.0.1: 在OpenCV根目录下面新建一个文件夹,比如叫做build_cmd。因为OpenCV要求 CMAKE_BINARY_DIR 不和 CMAKE_SOURCE_DIR 是同一个文件夹,所以不能在根目录下直接执行cmake cd到build_cmd 执行如下命令,路径对应修改 E:\Android\Sdk\cmake\3.10.2.4988404\bin\cmake.exe ^ -DCMAKE_TOOLCHAIN_FILE=E:\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake ^ -DANDROID_NDK=E:\Android\Sdk\ndk-bundle ^ -DANDROID_ABI="arm64-v8a" ^ -DANDROID_SDK=E:\Android\Sdk ^ -DWITH_TBB=ON ^ -DCPU_BASELINE=NEON ^ -DCPU_DISPATCH=NEON ^ -DOPENCV_ENABLE_NONFREE=ON ^ -DBUILD_ANDROID_EXAMPLES=OFF

Ubuntu18.04 从头开始编译 Android Native WebRTC

ぃ、小莉子 提交于 2020-03-19 19:59:12
3 月,跳不动了?>>> 本文详细记录Mac下使用PD虚拟机安装ubuntu18.4桌面版,编译Android Native WebRTC的过程。 注意如果仅仅是使用WebRTC没必要手动编译源码,直接用官方提供的预编译包即可: The easiest way to get started is using the official prebuilt libraries available at JCenter. These libraries are compiled from the tip-of-tree and are meant for development purposes only. On Android Studio 3 add to your dependencies: implementation 'org.webrtc:google-webrtc:1.0.+' On Android Studio 2 add to your dependencies: compile 'org.webrtc:google-webrtc:1.0.+' The version of the library is 1.0.. The hash of the commit can be found in the .pom-file. The third party licenses

为什么C ++编译需要这么长时间?

北城余情 提交于 2020-02-27 04:12:29
与C#和Java相比,编译C ++文件需要很长时间。 编译C ++文件所需的时间比运行普通大小的Python脚本要长得多。 我目前正在使用VC ++,但它与任何编译器都是一样的。 为什么是这样? 我能想到的两个原因是加载头文件和运行预处理器,但这似乎不应该解释为什么它需要这么长时间。 #1楼 大多数答案都有点不清楚,提到C#总是运行较慢,因为在编译时只执行一次C ++执行的操作,这种性能成本也会受到运行时依赖性的影响(需要加载更多的东西才能运行)运行),更不用说C#程序将始终具有更高的内存占用,所有这些都导致性能与可用硬件的能力更密切相关。 对于解释或依赖于VM的其他语言也是如此。 #2楼 在较大的C ++项目中减少编译时间的一种简单方法是制作一个* .cpp包含文件,其中包含项目中的所有cpp文件并进行编译。 这会将标题爆炸问题减少一次。 这样做的好处是编译错误仍将引用正确的文件。 例如,假设你有a.cpp,b.cpp和c.cpp ..创建一个文件:everything.cpp: #include "a.cpp" #include "b.cpp" #include "c.cpp" 然后通过make everything.cpp编译项目 #3楼 构建C / C ++:真正发生了什么,为什么需要这么长时间 软件开发时间的相当大一部分不用于编写,运行,调试甚至设计代码

CMake 3.8.0 generates wrong link command in makefiles

心不动则不痛 提交于 2020-01-23 02:47:12
问题 Problem: After I run cmake to generate a project with a STATIC library, which completes successfully, both ninja and mingw32-make fail to make their targets at linking. For SHARED libraries or executables this same setup worked fine. I've tried this both for "Ninja" and "MinGW Makefiles" generators: ninja output: [2/2] Linking CXX static library hello_wsl.lib FAILED: hello_wsl.lib cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E remove hello_wsl.lib && "" qc hello_wsl.lib

How do I build Google Crashpad into Shared (Dynamic) Libraries?

怎甘沉沦 提交于 2020-01-06 08:11:22
问题 Problem Summary I'm trying to integrate Google Crashpad, (successor of Google Breakpad) a crash reporting system, into a software suite that links to all of its external libraries dynamically. My problem is that the default of Crashpad is to build as a static library - I need to build it dynamically . After cloning Crashpad, GN is used to generate the .ninja files for the build. The build commands are as follows: $ gn gen out/Default The above command generates all of the .ninja files. (Aside

Clang build is extremely slow and hangs up in the middle

▼魔方 西西 提交于 2020-01-05 07:13:29
问题 I am getting started with writing my own clang tools. These are the steps I have followed so far: Checked out llvm 7.0 release build Checked out clang 7.0 release build Built clang and llvm using ninja with following flags (It was hanging up on me constantly without these) -DLLVM_USE_LINKER=gold -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_LINK_LLVM_DYLIB=true -DLLVM_USE_SPLIT_DWARF=ON -DBUILD_SHARED_LIBS=ON Installed clang Now I want to set clang as it's own compiler. So I have set these flags in

CMake building for Windows (clang-cl) using Ninja Generator

别来无恙 提交于 2020-01-03 17:22:45
问题 I am trying to build a simple application on a Windows machine using CMake as the main build tool. Once CMake is invoked on the project the is an error on configuration phase: > cmake -H. -G Ninja -Bbuild -DCMAKE_C_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -DCMAKE_CXX_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -- The C compiler identification is Clang 7.0.0 -- The CXX compiler identification is Clang 7.0.0 -- Check for working C compiler: C:/Program Files/LLVM/bin

CMake building for Windows (clang-cl) using Ninja Generator

陌路散爱 提交于 2020-01-03 17:22:05
问题 I am trying to build a simple application on a Windows machine using CMake as the main build tool. Once CMake is invoked on the project the is an error on configuration phase: > cmake -H. -G Ninja -Bbuild -DCMAKE_C_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -DCMAKE_CXX_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -- The C compiler identification is Clang 7.0.0 -- The CXX compiler identification is Clang 7.0.0 -- Check for working C compiler: C:/Program Files/LLVM/bin