mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-01 04:03:24 +03:00
Previously, `CMAKE_ASM${DIALECT}_COMPILER_FRONTEND_VARIANT` and
`CMAKE_ASM${DIALECT}_SIMULATE_ID` were not saved in with the build
configuration. As a result, these were left unpopulated on re-configure.
This is particularly problematic when `clang-cl` is used as the
assembler on Windows, since CMake would mistakenly identify the build as
being "GCC on Windows", resulting in include paths being passed with
forward slashes on re-configure, causing a full rebuild.
Fix the issue by saving the information so it persists across
re-configures.
31 lines
736 B
C
31 lines
736 B
C
#ifndef _CRT_SECURE_NO_WARNINGS
|
|
# define _CRT_SECURE_NO_WARNINGS
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
/*
|
|
Usage: pseudo_asm [--version] [-?]
|
|
|
|
--version: print a banner that identifies this program as Clang.
|
|
-?: return 0 for MSVC-like command-line, 1 for GNU-like command-line,
|
|
depending on the presence of the PSEUDO_ASM_GNU environment variable.
|
|
*/
|
|
int main(int argc, char* argv[])
|
|
{
|
|
int i;
|
|
for (i = 1; i < argc; ++i) {
|
|
if (strcmp(argv[i], "--version") == 0) {
|
|
printf("clang version 99.0.0 (pseudo_asm)\n");
|
|
return 0;
|
|
}
|
|
if (strcmp(argv[i], "-?") == 0) {
|
|
char const* gnu = getenv("PSEUDO_ASM_GNU");
|
|
return (gnu && *gnu) ? 1 : 0;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|