digitalmars.D.learn - importC and cmake
- jmh530 (17/17) Sep 06 2022 I was thinking about trying out importC with a library I have
- zjh (2/3) Sep 06 2022 `xmake` is simpler.
- jmh530 (3/6) Sep 07 2022 Ok...but I didn't write the library so I can't exactly tell them
- Chris Piker (3/4) Sep 27 2022 Thanks for the recommendation. Was struggling with cmake for a
- zjh (3/4) Sep 27 2022 `Xmake` is really nice!
- Chris Piker (10/14) Sep 29 2022 zjh
- zjh (9/12) Sep 29 2022 Try:
I was thinking about trying out importC with a library I have used in the past (it's been a few years since I used it with D). The library uses cmake to generate static or dynamic libraries (I believe I did static with Windows and dynamic with Linux, but I can't really recall). My understanding of cmake is that it is used to generate the files needed to build something in a cross-platform kind of way (so make files for linux, project files for Visual studio, etc.). This doesn't seem consistent with how importC works (which would be using a D compiler to compile the project). I suppose I could just try it and see if it works, but since the project uses cmake I wonder if there aren't potentially things that cmake is doing that are important and could get missed in this naive sort of approach (for instance, it has a way to use algorithms written in C++ by default, though they can be disabled in the cmake file). Does anyone have any importC experience with libraries that are built with a tool like cmake that could help make this clearer?
Sep 06 2022
On Tuesday, 6 September 2022 at 19:44:23 UTC, jmh530 wrote:.`xmake` is simpler.
Sep 06 2022
On Wednesday, 7 September 2022 at 00:31:53 UTC, zjh wrote:On Tuesday, 6 September 2022 at 19:44:23 UTC, jmh530 wrote:Ok...but I didn't write the library so I can't exactly tell them to use xmake when they already use cmake..`xmake` is simpler.
Sep 07 2022
On Wednesday, 7 September 2022 at 00:31:53 UTC, zjh wrote:`xmake` is simpler.Thanks for the recommendation. Was struggling with cmake for a dependent clib. Xmake is indeed simpler.
Sep 27 2022
On Wednesday, 28 September 2022 at 05:29:41 UTC, Chris Piker wrote:`Xmake` is indeed simpler.`Xmake` is really nice!
Sep 27 2022
On Wednesday, 28 September 2022 at 06:04:36 UTC, zjh wrote:On Wednesday, 28 September 2022 at 05:29:41 UTC, Chris Piker wrote:zjh Sorry to go off topic for a moment, but do you happen to know how to tell xmake that my project is C only, and thus it shouldn't add the /TP flag to cl.exe? The obvious statement: ```lua set_languages("c99") ``` doesn't accomplish that task. Thanks for the help,`Xmake` is indeed simpler.`Xmake` is really nice!
Sep 29 2022
On Thursday, 29 September 2022 at 20:56:50 UTC, Chris Piker wrote:```lua set_languages("c99") ```Try: `add_cxflags` or `add_files("src/*.c")` or `set_languages("c")` or `set_languages("c11")` . or ,use `-l` to set language. ```cpp xmake create -l c -t static test ```
Sep 29 2022