Crossplatform Compilation Summary

 

Architecture ARM - Linux:

Linux tegra-ubuntu 4.4.38-tegra aarch64 :  gcc 5.4.0 : cmake 3.5.1

Unix makefile 編譯通過, 包括編譯選項 -march=armv8-a  和 -march=armv8-a+crypto -mcpu=cortex-a57+crypto

Architecture X86_64 - Win10:

MinGW+ Msys + VS2017:

windows 下 cmake 生成 visual studio 2017 的解決方案,然後修改項目引用路徑,手動添加依賴庫configparser,修改linux下的引用文件......

1.Install the MinGW to enable CMAKE works.

2.Run CMAKE to generate cmake files like vs solution related files.

3.Modify the project configuration: remove   /Wl,--no-as-needed compilation option

4.Manually add config_parser.h and config_parser.cpp

5.Modify the source file, add condition compilation macro, replace linux header file and implement used linux system function like realpath(), getpid()... etc.

MinGW + MSYS + GCC:

安裝的時候要選擇posix 線程模型以支持C++11 thread: threads-posix發行版將使用 posix API並允許使用 std:: thread,threads-win32將使用 win32api,並禁用標準的std::thread 部分

【 mingw-w64線程模型:posix vs win32(posix允許使用c++11的std:: thread,但要帶一個winpthreads,可能需要額外dll) 】

https://stackoverflow.com/questions/17242516/mingw-w64-threads-posix-vs-win32

最終MinGW下的編譯方式成功,但仍更改了小部分代碼,去掉了syscall() 的引用,增加 了realpath的win下的實現

CygWin:

操作同linux,直接git clone   cmake    make就搞定了。。。

About gradle:

windows上要是的gradle能自動解析並下載依賴包,需要安裝jdk並添加pah環境變量,再運行gradlew.bat,但要注意改build.properties文件的引用庫平臺以及所下載的依賴庫版本,顯然linux下的庫在windows下無法引用。

當出現執行gradle,FAILIURE:Build failed with an exception,檢查gradle和jdk版本匹配問題

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章