I actually have CMake working with this toolchain today, but we’ve forked CMake’s module files, and it makes it a huge pain every time we want to upgrade to a new CMake version. I’d actually be fine making the assumption “our cmake never runs try_compile”, because I already have perfect information about the compiler ahead of time, and there’s no reason for me to “try” anything. So there’s just no way I can find to do this without doing surgery on the builtin modules. The standard vcxproj that is generated by cmake ( ) is not correct for this particular toolchain setup, because it requires a certain Property sheet to be imported in the generated MSBuild, and it requires a different syntax for the main function. When you call cmake path, you ask it to generate a Makefile in the current directory following instructions given in path/CMakeLists.txt Usually cmake output some messages while it is working, and after it is done without errors, you can type 'make' to execute your newly created Makefile. And it’s supported by a Visual Studio extension provided by the console vendor, that installs hooks into MSBuild. And it also requires some very unique syntax when doing compilation. This is for a video game console toolchain, which has very tight hooks into MSBuild. I’m pretty convinced at this point that my only way out here is going to be to somehow convince CMake to never, ever, ever try running the compiler during the configure step. But I can’t find a magic variable that will do this. Is there anything I can do to force skip the feature detection step? One idea I have is to do the surgery on the cmake modules to get it to all pass, then copy/paste all of the auto-detected values into a toolchain file, and then set a magic variable to really force cmake to skip it all. I’m willing to do whatever it takes to make this work, even if it’s undocumented, gross, or ugly. This particular toolchain is hard-locked to a Visual Studio solution, and the automatically generated sln and main.cpp files that cmake tries to compile when the generator is Visual Studio do not contain valid code for this particular toolchain. The documentation for CMakeForceCompiler says that CMake can be taught to detect any kind of toolchain, but this doesn’t seem to be true in my case. Set(CMAKE_CXX_COMPILER /path/to/cxx/compiler)īut it’s still trying to do a lot of feature detection, which breaks unless I go do surgery on the CMake module code. I’ve tried doing this in my toolchain file: set(CMAKE_C_COMPILER /path/to/c/compiler) I’m trying to write a toolchain file for a custom C / C++ toolchain.
0 Comments
Leave a Reply. |