Multifile/CMake feedback thread #2763
Replies: 16 comments 21 replies
-
I tried the first example on iPad in Safari … I don’t know if you were expecting it to work on ipad, but thought I should log it just in case… |
Beta Was this translation helpful? Give feedback.
-
@partouf Patrick: this is AWESOME! I just discovered this feature now and will update with feedback after I play around with it. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Seems not to be working for MSVC yet? It tries to compile CMake files as C++, and when I disable cmake it isn't able to include header files I add ("No such file or directory"). |
Beta Was this translation helpful? Give feedback.
-
A while back, someone posted a useful guide for CE & CMake @ https://ggulgulia.medium.com/compiler-explorer-with-cmake-94fd38d5012f |
Beta Was this translation helpful? Give feedback.
-
very nice indeed! One question though: What does one need to add to the CMakeLists.txt file to include and link libs like googletest ? (Two lines which apparently will not do the trick have been commented out from the CMakeLists.txt file.) |
Beta Was this translation helpful? Give feedback.
-
I find the option to upload zip source code very helpful. However the file doesn't seem to reload if you upload a new zip? |
Beta Was this translation helpful? Give feedback.
-
I don't see a way to add additional cmake files for scripts. We seem to just get one CMakelists.txt. It might be useful to have a way to just run cmake on its own - as a script language not as a means to organize c++ builds. |
Beta Was this translation helpful? Give feedback.
-
Someone recently made a set of CMake files to chain Cpp2-cppfront to a regular C++ compiler https://godbolt.org/z/dT87zrWbP - from modern-cmake/cppfront#1 |
Beta Was this translation helpful? Give feedback.
-
Example of a cmake that compiles c/c++ along with some nasm https://godbolt.org/z/qqW1KWhhq |
Beta Was this translation helpful? Give feedback.
-
Earlier this year this video was posted by @lefticus about showing LTO effects via CMake in CE https://www.youtube.com/watch?v=pyiKhRmvMF4 |
Beta Was this translation helpful? Give feedback.
-
We recently installed a new CMake that makes things easier yet again to make c++ modules work; Via https://twitter.com/bretbrownjr/status/1640786959801917453 Without too much trouble in your cmake file; https://godbolt.org/z/von5MfK7T Doesn't work for gcc yet, unfortunately. More info at https://www.kitware.com/import-cmake-c20-modules/ |
Beta Was this translation helpful? Give feedback.
-
Getting "cannot find library" linker error when using target_link_libraries. Looks like the same examples posted earlier are showing same linker error: https://godbolt.org/z/5cP9qEzh7. Tried different compiler versions and different libraries. Can't get any libraries to link using CMake. |
Beta Was this translation helpful? Give feedback.
-
When changed into
When changed into
[LIVE]
[LIVE] |
Beta Was this translation helpful? Give feedback.
-
Does anyone have an example of this working with MSVC without CMake but with multiple .cpp files? |
Beta Was this translation helpful? Give feedback.
-
Any example of this in Java/Scala? |
Beta Was this translation helpful? Give feedback.
-
I tried a multi file project using the |
Beta Was this translation helpful? Give feedback.
-
We have implemented a way for you to compile programs using multiple files, and if it's C/C++ code, you can make the files link to each other through CMake.
Current implementation details
output.s
unless you specify it in the UIexample.cpp
(in case of C++ ) and you'll need to change the extension to if you're using a different languagetarget_link_libraries()
call manually to yourCMakeLists.txt
Examples that can get you started
Beta Was this translation helpful? Give feedback.
All reactions