Skip to content
  • Brad King's avatar
    Compile with explicit language flag when source LANGUAGE property is set · 48aac247
    Brad King authored
    This change was originally made by commit 74b1c9fc (Explicitly specify
    language flag when source LANGUAGE property is set, 2020-06-01,
    v3.19.0-rc1~722^2), but it was reverted by commit 30aa715f (Revert
    "specify language flag when source LANGUAGE property is set",
    2020-11-19) to restore compatibility with pre-3.19 behavior.
    
    Implement the change again, but add policy CMP0119 to make this change
    while preserving compatibility with existing projects.
    
    Note that the `Compiler/{Clang,Intel,MSVC}-CXX` modules do not need to
    specify `-TP` for their MSVC-like variants because we already use the
    flag in `CMAKE_CXX_COMPILE_OBJECT`.  Similarly for `Compiler/XL-CXX`
    and `Platform/Windows-Embarcadero`.
    
    Note also that this does not seem possible to implement for XL C.
    Even with `-qsourcetype=c`, `xlc` complains about an unknown suffix:
    `1501-218 (W) file /.../AltExtC.zzz contains an incorrect file suffix`.
    It returns non-zero even with `-qsup...
    48aac247