From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Project out of sources compilation Date: Sat, 16 Mar 2024 14:12:50 +0100 Message-ID: <4wwljrdnra3bsloehioa46y24ozxajajmvf2elvskxxq3mhtg2@pyv2z5snot6h> References: <4wwljrdnra3bsloehioa46y24ozxajajmvf2elvskxxq3mhtg2.ref@pyv2z5snot6h> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39399"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 16 14:13:49 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rlTrB-000A5d-53 for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Mar 2024 14:13:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlTqV-0007ay-Ah; Sat, 16 Mar 2024 09:13:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlTqS-0007XO-Uj for emacs-devel@gnu.org; Sat, 16 Mar 2024 09:13:05 -0400 Original-Received: from sonic316-11.consmr.mail.bf2.yahoo.com ([74.6.130.121]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlTqN-0005kf-AJ for emacs-devel@gnu.org; Sat, 16 Mar 2024 09:13:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1710594775; bh=+Ax1PDveTVw4bTVr6Pc/jH9ijrjfo3ka9apz0Cr5ozQ=; h=Date:From:To:Cc:Subject:References:From:Subject:Reply-To; b=SFZOEeIUE61EfTLqz44tnd0ttGY3NyPHrZgMiZcSMcpjJjgM64CDx6V99J7WlX5RjEDJx9cjYXqtrxWEOjMTtZdEHqd8WR88PALBzzIJ1PXbGLQ0qErOhW1zAew2lOcvYyWKAdIlwWfTF4JAHuCoMpLODkkTU9717vLB3kssHyaVY7VFxsdNVW2JUAJzV4JgPkrq3N47+fU7hRPC/vSgmfOkwIjnadDdXjCPH8oe6d/4UTEL5HPdzammdaz0x7U7rBuCsrmSxD9xk00SfMgSa0XlkmmLOZRMPatEiohbTynSAIiiO46lzFeVgVn7AwTERbI3D5d6oNBYuguGQJw9PQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1710594775; bh=f8W6ynE6Hc+Ec5Qc48MqvWqkh1oOzuciJyb2Rv4AEtS=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=PVGZpTPNDjEAzA/9VwBVT4EQ4HS0/OX4iRbU2CNGKuFweiioap8xskE7Wc3f2kpcf+U425IYCPCy7D7+j3u9OZ+TH8BHwM60wQd5CEih9gM3GiuehYlBmFYpLuAzGy/UqJJ+uIbXIQSb03u5XQFn6TLpkTJGAxH5k3FgrHymB47Dx1dj+tO3b6uKD+J9nSJt9Xhkyhfws7rUFR1b2f2JRzdSQ4fk5SfmkZz8sXAB/2wZ2kUv3WCB3BnRKhd8lC8Md3RxQjdsnGpBZuex1RIXtnaR+ThqiDbo7I20+r8RTAkyev8Mim2GR3nA5OkYtUXNWdABpCuRxRdGUPV7QSYFKA== X-YMail-OSG: 35oe6hoVM1lAtSZBv3NZY7AB7zwhScGvbrzKlf.gEMTG29VB.Gf0uyNnY_YOCcf mhvdFhgaGgq16q0CyzdSGGzT23PV45DED8Hz59pJx5IaMkwv8khLtzTjzDVkvNnW4AoTGyEDluO6 8x.WHNQBSYVV0RZ1HRzJLuE9P1l3ETv1Uiv3ro9CfAxKrHUJto2XgBd2BNSBTqrCmaiKk0zHOkFN tcNs6FRU.pPvyGSB33ghERKRZD5yBViKMuwwCzwSFmx6g_S4N9eD6AozxOzbm__pDK.1HWuvpwhn v5DmJketSzkNB6iqPeg_e.17ObAE8kUkmlZ2iVDdxpoWqMfbDHo7Wd9Wbl8.DYMVf3dnaG.RpBOC DNN8DPWI9dHGQbI8PHUbYRdV3MsFX49w7l8Qt6oBd4MsAnelMMkmSF199xQvVM.yZ3NfidjpKa8j G80Hc1L7YOTtquiD_VLjPAhwIwXG5GrAXRS5p8J5JAgTlnA1pwOnNIHI9tC_C_pET7orbI85Qrao TxtxCWfWhq9vxevlUX8tofqyh11tVBGYzgU9O8FBL3xO6yghvjvliBu6MFsoBTWtN6C3xS6NQtkT vZ8rGSH9rKH0wVSXoHyIT88sowchgYypn4tXE7a8vvCkD1XZCoWlDPwI9MzT_hxCiKwsTh5gghSR mlSababVtIvKP4t0BTLuz2Xn4rEbkF9cJG2s1rJHaEuUA7RuNuJpPR3txaDWnQbA820CLCIQp.i7 9SHmX5eNaquSm5CzZILXA4Slo_s_khiwEeRayvIi.9UALfx37GEf5kJpQkWZjRJbF9u63FugLYva Iw4EjUZQKGLY_o1f1jE1b2rjt4_KL052Sw0_O70UuD X-Sonic-MF: X-Sonic-ID: fad5f563-1cc1-4661-a6b7-9f01102ccdc8 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.bf2.yahoo.com with HTTP; Sat, 16 Mar 2024 13:12:55 +0000 Original-Received: by hermes--production-ir2-7bc88bfc75-6cqn4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d1222f2089a61d647c702a047d684ccf; Sat, 16 Mar 2024 13:12:52 +0000 (UTC) Content-Disposition: inline X-Mailer: WebService/1.1.22129 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.130.121; envelope-from=spacibba@aol.com; helo=sonic316-11.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317109 Archived-At: Hi: These days I have been working with cmake projects here and there and in spite of I could handle most of the work from emacs, it required a lot of extra time to make it more or less comfortable. I wrote a couple of simple functions to manage my needs, but at the end I think that there are some small piece missing to handle common workflows and glue everything (with the users in mind of course): 1. Out of sources compilation. Most of projects now prefer to do out-of sources compilation. Either to keep source code clean or to keep multiple compilations at the same time (i.e Debug/Release/win32) The project.el package has already some compilation commands, but they assume that the compilation will be executed in the project's root... which is not true most of the time. Maybe we may add an extra custom variable that could be specified in the dir-locals.el in order specify where the compilation command must be executed. Some more heuristics here is possible, but I would settle for at least something simpler. 2. Eglot compilations database place. When compilation is out of sources the cmake generated compile_commands.json also goes in that directory by default. This issue can be managed with a line in dir-locals, or just manually coping the database. ((eglot-workspace-configuration . (:clangd (:initializationOptions (:compilationDatabasePath "build"))))) Probably some simple slight integration of Eglot with Project may help. 2.1 This mixes with the previous one because if we change the compilation directory the line with initializationOptions is not updated and requires manual intervention 3. Projects multiple backends This one is tricky because at the moment I have gtags-mode, that includes a backend for project.el, there is the default backend, but also we could add something called cmake-backend (i.e looks for CMakeLists.txt that includes a 'project' entry) In that case emacs cannot use all the information form the three even if it is not contradictory, so the user ends up opening the terminal and doing things manually. 4. Flymake integration Even without eglot, flymake should be capable to work very easily with cmake projects. This step is also a stage before doing a proper plugin integration of tools like cppcheck for flymake. 5. Project local variables (a man can dream, a man can dream) There are some situations where we want to have variables shared among a project. (i.e some output directory, logging option when executing, flags, environment variables). At the moment these options work partially by using directory variables. If we have the concept of a "project", maybe it is logical to have some sort of project scope concept, specially for projects sharing a common root. For example vs-code adds a subdirectory with project variables that the user (but also any plugin) can refer to in the project's scope. -- I could try to implement some of this with your help; but I need some feedback on which of them are desired and which are not. Or which ones are maybe better to put as feature requests for a more skilled lisper or package maintainer. WDYT? Ergus