mirror of
https://github.com/reactos/CMake.git
synced 2024-11-25 04:29:52 +00:00
try_compile: Preserve special characters in COMPILE_DEFINITIONS
When generating the `CMakeLists.txt` file, we pass the values given to our `COMPILE_DEFINITIONS` option in an `add_definitions` call. Pass them as bracket arguments to preserve special characters like `#`.
This commit is contained in:
parent
15ad830062
commit
8c5221fb1f
@ -599,7 +599,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
|
||||
fprintf(fout, "link_directories(${LINK_DIRECTORIES})\n");
|
||||
// handle any compile flags we need to pass on
|
||||
if (!compileDefs.empty()) {
|
||||
fprintf(fout, "add_definitions(%s)\n", cmJoin(compileDefs, " ").c_str());
|
||||
// Pass using bracket arguments to preserve content.
|
||||
fprintf(fout, "add_definitions([==[%s]==])\n",
|
||||
cmJoin(compileDefs, "]==] [==[").c_str());
|
||||
}
|
||||
|
||||
/* Use a random file name to avoid rapid creation and deletion
|
||||
|
Loading…
Reference in New Issue
Block a user