[cfe-dev] [RFC] New file extension for compiling C++ for OpenCL sources

Anastasia Stulova via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 18 03:40:45 PST 2021


Good point - another similar example would be the syntax highlight
in the IDEs or editors that frequently use the file extensions too.

________________________________
From: cfe-dev <cfe-dev-bounces at lists.llvm.org> on behalf of Stephen Kelly via cfe-dev <cfe-dev at lists.llvm.org>
Sent: 17 February 2021 22:12
To: cfe-dev at lists.llvm.org <cfe-dev at lists.llvm.org>
Subject: Re: [cfe-dev] [RFC] New file extension for compiling C++ for OpenCL sources


On 17/02/2021 16:36, Arthur O'Dwyer via cfe-dev wrote:
> FWIW, as a complete outsider, as a complete non-user of OpenCL (but a
> heavy user of C++), I don't see why a new filename extension is a good
> thing.


I'm also an opencl outsider.

However, if opencl files are to be detected by a buildsystem like (but
not limited to) cmake, then a file extension is a good thing. Consider
this cmake code:

cmake_minimum_required(VERSION 3.10)

project(testproj C CXX OBJCXX OBJC)

add_library(test
     test.cpp
     test.c
     test.m
     test.mm
)


CMake detects the source-language of each source file and uses the
appropriate driver and language compile option for each one.

With a file extension for opencl, CMake could use the appropriate
driver/option for that language too. Without a distinct file extension
for it, the user would have to tell cmake what the language is, which is
inconvenient for the user.

Thanks,

Stephen.


_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210218/39e93f9f/attachment.html>


More information about the cfe-dev mailing list