I don't want to modify Azure IoTHub sources in order to keep it unchanged and easy to maintain. I hope somebody can teach me how to improve my toolchain-file. I've tried to use CMAKE_EXE_LINKER_FLAGS, CMAKE_SHARED_LINKER_FLAGS, link_directories, and link_libraries, all of above failed. So, I think there must be something wrong in my toolchain-file. However, if I manually copy libuuid.so.1 and libuuid.so.1.0.0 to the path within my cross-compiler( /usr/local/bin/compile_tool/arm-2010q1/arm-none-linux-gnueabi/lib), it can successfully link libuuid. This set of toolchains is supported from hosts Windows, Mac and Linux. ![]() rwxr-xr-x 1 root root 41893 十一 9 13:57 libuuid.so.1.0.0ĭrwxr-xr-x 2 root root 4096 十一 9 13:57 pkgconfig CMake and Bazel build files are also provided by all modules, allowing Pigweed. Lrwxrwxrwx 1 root root 16 十一 9 13:57 libuuid.so -> libuuid.so.1.0.0 Most platforms including Linux, Windows, and Mac OS X even have native graphical user interfaces for cmake, and it can create project files for almost any. I've downloaded libuuid sources and built it into /myspace/application/libuuid/lib/: ls -l SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) In order to use CMake for cross-compiling, a CMake file that describes the target platform has to be created, called the toolchain file, This file tells CMake. SET(CMAKE_FIND_ROOT_PATH /myspace/application/libuuid/lib) # But I can't link libuuid by setting CMAKE_FIND_ROOT_PATH. INCLUDE_DIRECTORIES(/myspace/application/libuuid/include) # I can use INCLUDE_DIRECTORIES to find uuid.h Note that 2019 version is required, the code will not compile against. SET(OPENSSL_INCLUDE_DIR /myspace/application/openssl/include) The toolchain file tells Cmake to use VCPKG to manage the libraries for the given. SET(OPENSSL_CRYPTO_LIBRARY /myspace/application/openssl/libcrypto.so) SET(OPENSSL_SSL_LIBRARY /myspace/application/openssl/libssl.so) SET(CMAKE_CXX_COMPILER /usr/local/bin/compile_tool/arm-2010q1/bin/arm-none-linux-gnueabi-g++) SET(CMAKE_C_COMPILER /usr/local/bin/compile_tool/arm-2010q1/bin/arm-none-linux-gnueabi-gcc) Makefile:140: recipe for target 'all' failedīelow is my toolchain-file: INCLUDE(CMakeForceCompiler) ![]() The CMake-based build system will become the default build system in ESP-IDF V4.0. If you encounter any gaps or bugs, please report them in the Issues section of the ESP-IDF repository. Make: *** Error 1ĬMakeFiles/Makefile2:1327: recipe for target 'iothub_client/samples/iothub_convenience_sample/CMakeFiles/iothub_convenience_sample.dir/all' failed This is documentation for the CMake-based build system which is currently in preview release. Iothub_client/samples/iothub_convenience_sample/CMakeFiles/iothub_convenience_sample.dir/build.make:128: recipe for target 'iothub_client/samples/iothub_convenience_sample/iothub_convenience_sample' failed Linking C executable iothub_convenience_sample Building C object iothub_client/samples/iothub_convenience_sample/CMakeFiles/iothub_convenience_sample.dir/_/_/_/certs/certs.c.o ![]() ![]() Building C object iothub_client/samples/iothub_convenience_sample/CMakeFiles/iothub_convenience_sample.dir/iothub_convenience_sample.c.o build.sh -no-amqp -no-http -no_uploadtoblob -no-logging -toolchain-file mytoolchain.cmakeĪnd here is the build result, ld cannot find -luuid: Scanning dependencies of target iothub_convenience_sample This is my command: azure-iot-sdk-c/build_all/linux#. If this makes a difference: PROJECT is called before the inclusion end execution of the macro, that shows the wrong sysroot.I don't know how to write CMake toolchain-file properly to build Azure IoTHub SDK v1.2.10 successfully. Cleaning the whole build-directory (which I'm sure I did yesterday too) and rerunning CMake resets CMAKE_OSX_SYSROOT now. INCLUDE("$/usr/lib/libSystem.B.dylib for possible architectures")Īm I using CMake wrongly here? Why is CMake resetting the OSX_SYSROOT? According to it should also affect FIND* commands but I needed to set CMAKE_FIND_ROOT_PATH for it to work. The toolchain file looks like this: SET(CMAKE_SYSTEM_NAME Darwin) To do this I use a toolchain file, so the call is like this: cmake -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchains/c. I'm cross compiling from Linux to OSX using CMake.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |