You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
I have prototyped a build script modeled after Intel Edison build script and it's corresponding environment setup script from Intel Edison toolchain. When my build script starts, it sets up the environment, and calls cmake on build_root, the top level CMakeLists.txt performs the compiler checks and they pass.
-- Check for working C compiler: /home/chris/mgc-cedar-minnowmax/embedded/codebench/bin/i686-pc-linux-gnu-gcc -- works
But as soon as the build system descends into any submodule, these checks fail: (some debug messages() have been added)
-- CMAKE_SOURCE_DIR: /scratch/sandbox/azure-iot-gateway-sdk/deps/ctest -- Check for working C compiler: /home/chris/mgc-cedar-minnowmax/embedded/codebench/bin/i686-pc-linux-gnu-gcc -- broken
Upon further inspection, the variables that were set in the toolchain_file passed to cmake (using cmake's SET() directive) are blank, ie they have not been propagated into the submodule. Therefore, all my CFLAGS and LDFLAGS are effectively null, and the compiler check naturally fails.
What I know about cmake could fill a paragraph, and not more (well, actually I'm learning way more than I ever wanted to about cmake LOL!)
Where am I going wrong?
Note that I faced a similar failed compiler check running the Intel Edison example using the stock Edison toolchain and corresponding build script. I documented that in #71
The text was updated successfully, but these errors were encountered:
Hello @challinan, our own Intel Edison and Wind River Linux cross-compiles are interesting. They really weren't taking advantage of CMake's toolchain capability - they were setting up the environment to use the native build tools and set the target sysroot. It works for the specific toolchains we have, but we ran into similar problems on other platforms.
One interesting thing to note: CMake doesn't populate its own variables until after the project statement, and your cross-compile is failing in the "project" statement. This, if I may say so myself, is very frustrating.
I can definitely confirm one problem: When we build our submodule dependencies, we're not sending the toolchain option. I should have a new commit coming soon which address this.
I believe it is the submodule problem we are seeing. At one point, I was "guessing" that cmake was actually either dropping or changing our toolchain variables. This would certainly explain that behavior. Thanks for looking at this.
I have prototyped a build script modeled after Intel Edison build script and it's corresponding environment setup script from Intel Edison toolchain. When my build script starts, it sets up the environment, and calls cmake on build_root, the top level CMakeLists.txt performs the compiler checks and they pass.
-- Check for working C compiler: /home/chris/mgc-cedar-minnowmax/embedded/codebench/bin/i686-pc-linux-gnu-gcc -- works
But as soon as the build system descends into any submodule, these checks fail: (some debug messages() have been added)
-- CMAKE_SOURCE_DIR: /scratch/sandbox/azure-iot-gateway-sdk/deps/ctest
-- Check for working C compiler: /home/chris/mgc-cedar-minnowmax/embedded/codebench/bin/i686-pc-linux-gnu-gcc -- broken
Upon further inspection, the variables that were set in the toolchain_file passed to cmake (using cmake's SET() directive) are blank, ie they have not been propagated into the submodule. Therefore, all my CFLAGS and LDFLAGS are effectively null, and the compiler check naturally fails.
What I know about cmake could fill a paragraph, and not more (well, actually I'm learning way more than I ever wanted to about cmake LOL!)
Where am I going wrong?
Note that I faced a similar failed compiler check running the Intel Edison example using the stock Edison toolchain and corresponding build script. I documented that in #71
The text was updated successfully, but these errors were encountered: