Okay so I have a setup where we build LuaJIT using CMake The CMake script is third-party. At the moment I'm using the one that ships with luvit I want to build for Android That's a cross compile But! LuaJIT builds two separate small programs and uses them as add_custom_command's
-
Show this thread
-
So obviously this doesn't work in a cross-compilation situation. I need to build the custom_commands for mac (or whatever the build host is) and the app itself for ARM. How do I do this? Whitequark mentioned some projects deal with this by having cmake recursively call itself…?
2 replies 0 retweets 3 likesShow this thread -
Replying to @mcclure111
yup. to bring back context, this is what llvm uses. i can simplify that for you so it doesn't have llvm-specific fluff if that's what you want to go withhttps://github.com/llvm-mirror/llvm/blob/master/cmake/modules/CrossCompile.cmake …
1 reply 0 retweets 2 likes -
Replying to @whitequark
thanks… i may ask you about stripping this down if I can't find another solution. one thing that confuses me is how the "inner" cmake would know what the build-host platform even is
1 reply 0 retweets 1 like -
Replying to @mcclure111
oh! you ask inner cmake to "just" compile, not cross-compile, so it uses its built-in knowledge the same way it'd use it if you tried to build something for macos without any cross-compilation flags
1 reply 0 retweets 1 like -
Replying to @whitequark @mcclure111
i.e. you *avoid* passing the inner cmake a "toolchain" file
1 reply 0 retweets 1 like -
Replying to @whitequark
Okay. Interesting… what's slightly complicated about this is that cmake is being internally invoked by Gradle, since it's got all the horrible secret knowledge about how to make an android app. I bet I can assume system cmake is in PATH, though?
2 replies 0 retweets 1 like -
Replying to @mcclure111 @whitequark
Ie, whatever mechanism is setting up the tool chain is hidden from me
1 reply 0 retweets 1 like
gradle is passing the -T../some-toolchain.cmake argument to cmake to make it cross-compile. cmake doesn't respect environment variables so it has to be pretty explicit and unmagical
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.