Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KonanM
CMake
Commits
c9c79dde
Commit
c9c79dde
authored
3 years ago
by
Thomas Bernard
Committed by
Brad King
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Clang: Add MSVC frontend detection for the ASM compiler
Fixes: #22495
parent
ed9abd99
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/CMakeDetermineASMCompiler.cmake
+18
-1
18 additions, 1 deletion
Modules/CMakeDetermineASMCompiler.cmake
with
18 additions
and
1 deletion
Modules/CMakeDetermineASMCompiler.cmake
+
18
−
1
View file @
c9c79dde
...
...
@@ -125,6 +125,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
include
(
CMakeDetermineCompilerId
)
set
(
userflags
)
CMAKE_DETERMINE_COMPILER_ID_VENDOR
(
ASM
${
ASM_DIALECT
}
"
${
userflags
}
"
)
set
(
_variant
""
)
if
(
"x
${
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ID
}
"
STREQUAL
"xIAR"
)
# primary necessary to detect architecture, so the right archiver and linker can be picked
# eg. "IAR Assembler V8.10.1.12857/W32 for ARM" or "IAR Assembler V4.11.1.4666 for Renesas RX"
...
...
@@ -137,6 +138,19 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
if
(
_all_compileid_matches
)
list
(
GET _all_compileid_matches
"-1"
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ARCHITECTURE_ID
)
endif
()
elseif
(
"x
${
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ID
}
"
STREQUAL
"xClang"
)
# Test whether an MSVC-like command-line option works.
execute_process
(
COMMAND
${
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER
}
-?
OUTPUT_VARIABLE _clang_output
ERROR_VARIABLE _clang_output
RESULT_VARIABLE _clang_result
)
if
(
_clang_result EQUAL 0
)
set
(
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_FRONTEND_VARIANT
"MSVC"
)
set
(
CMAKE_ASM
${
ASM_DIALECT
}
_SIMULATE_ID MSVC
)
else
()
set
(
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_FRONTEND_VARIANT
"GNU"
)
endif
()
set
(
_variant
" with
${
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_FRONTEND_VARIANT
}
-like command-line"
)
endif
()
_cmake_find_compiler_sysroot
(
ASM
${
ASM_DIALECT
}
)
...
...
@@ -144,6 +158,8 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
unset
(
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ID_OUTPUT
)
unset
(
_all_compileid_matches
)
unset
(
_compileid
)
unset
(
_clang_result
)
unset
(
_clang_output
)
endif
()
if
(
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ID
)
...
...
@@ -157,9 +173,10 @@ if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
else
()
set
(
_archid
""
)
endif
()
message
(
STATUS
"The ASM
${
ASM_DIALECT
}
compiler identification is
${
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ID
}${
_archid
}${
_version
}
"
)
message
(
STATUS
"The ASM
${
ASM_DIALECT
}
compiler identification is
${
CMAKE_ASM
${
ASM_DIALECT
}
_COMPILER_ID
}${
_archid
}${
_version
}
${
_variant
}
"
)
unset
(
_archid
)
unset
(
_version
)
unset
(
_variant
)
else
()
message
(
STATUS
"The ASM
${
ASM_DIALECT
}
compiler identification is unknown"
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment