Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,187
    • Issues 3,187
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 14
    • Merge Requests 14
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • CMake
  • CMakeCMake
  • Merge Requests
  • !5519

Merged
Opened Nov 19, 2020 by Brad King@brad.kingOwner

Revert "specify language flag when source LANGUAGE property is set"

  • Overview 4
  • Commits 1
  • Pipelines 4
  • Changes 20

Revert !4780 (merged). The purpose of that change was to convert an explicit LANGUAGE source file property into an explicit language specification compiler flag like -x c. This seems reasonable since the property is documented as meaning "indicate what programming language the source file is". It is also needed to help compilers deal with non-standard source file extensions they don't recognize.

However, some projects have been setting LANGUAGE C on .S assembler source files to mean "use the C compiler". Passing -x c for them breaks the build because the .S sources are not written in C. These projects should be updated to use enable_language(ASM), for which CMake often chooses the C compiler as the assembler when using toolchains that support it (which would have to be the case for projects using the approach).

Revert the change for now to preserve the old behavior for such projects. We can re-introduce it with a policy in a future version of CMake.

Fixes: #21469 (closed)
Issue: #14516 (closed), #20716 (closed)
Backport: release

Assignee
Assign to
Reviewer
Request review from
3.19.1
Milestone
3.19.1 (Past due)
Assign milestone
Time tracking
Reference: cmake/cmake!5519
Source branch: revert-explicit-LANGUAGE-flag

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.