09 February 2020, 22:08 | #1 |
Registered User
Join Date: Jan 2008
Location: somewhere
Posts: 45
|
VBCC, CLion and CMake sample project
Hi
I'm looking for a (simple) CMake project using VBCC and (ideally with) CLion. I'm stuck at moving from gcc to vbcc in my CMakeFile. I have to tricks CLion with a nice "set(CMAKE_C_COMPILER_WORKS TRUE)" in the CMakeLists.txt, but I have the nice following error : Code:
Compiler exited with error code 1: /opt/vbcc/bin/vc -xc +aos68k ~/dev/kernel_amiga/rom/libraries/exec/io/CreateIORequest.c -I~/dev/kernel_amiga/rom/includes -fpch-preprocess -v -dD -E Iliak |
10 February 2020, 10:29 | #2 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
I have neither experience with CMake nor with CLion, but did you try to execute the command in a shell to find out why it fails? It will certainly give you a helpful error message.
From a quick look at the command line given I would say that -xc and -fpch-preprocess are no valid vbcc options. |
10 February 2020, 14:05 | #3 |
Registered User
Join Date: Jan 2008
Location: somewhere
Posts: 45
|
Hi Phx,
The problem is that thoses parameters are automagically added by CLion not by me... My idea is to adapt a working project to CLion |
12 February 2020, 08:36 | #4 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
I created a project here https://github.com/skeetor/amiga-utils where I integrated gcc and vasm into a cmake compiler. The relevant files can be found here: https://github.com/skeetor/amiga-uti...utilslib/CMake
I had to create a new "compiler" to make it work. The advantage is that the projectfiles are then rather small: Here is a sample how my CMake project file looks: https://github.com/skeetor/amiga-uti...CMakeLists.txt Don't know if that will work easily with CLion, as I also didn't get it to work with my setup. |
12 February 2020, 09:27 | #5 | |
Registered User
Join Date: Jan 2008
Location: somewhere
Posts: 45
|
Quote:
I'll have a look, thx |
|
12 February 2020, 10:08 | #6 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
If you create your own cmake compiler you don't need that enable language part, as C/CPP files are known anyway. You still have to create an appropriate VBCC compiler though, which tells cmake what options it needs to set.
If you get CLion to work, I would be interested in it, as I currently use Notepad++, but CLion is much nicer to use. There is also some support for cmake with cross compiling https://gitlab.kitware.com/cmake/com...CrossCompiling so maybe this is also some help. |
12 February 2020, 15:01 | #7 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
CLion works for me with gcc.
As an example see https://github.com/alexalkis/a68k/bl...CMakeLists.txt |
12 February 2020, 15:24 | #8 |
Registered User
Join Date: Jan 2008
Location: somewhere
Posts: 45
|
My current project uses m68k GCC-6.4 too, but I can't compile the following code :
Code:
long toto(register long a __asm("d1")) { return a; } I can't /don't know how to make gcc puts function parameters in registers... That's why I want to use vbcc |
12 February 2020, 15:35 | #9 | |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 405
|
Quote:
Code:
long toto(long a __asm("d1")); If you don't care about the specific registers and just want to avoid passing on the stack, I think the -mregparm option is meant to do that. |
|
12 February 2020, 15:56 | #10 | |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
Are you running CLion in Linux? I would assume that it might work there. On Windows I would liketo know how to set it up with MKSYS2 and the amigaos toolchain from bebbo. |
|
12 February 2020, 16:04 | #11 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
I have done some work with CMake as well: https://github.com/AmigaPorts/AmigaC...ossToolchains/
I haven't added VBCC, but VASM support, because I needed it in a project. This toolchain is used in the amigadev/crosstools:m68k-amigaos docker image. (source: https://github.com/AmigaPorts/docker-amiga-gcc/) This contains all the compiler modules needed to enable VASM: https://github.com/AmigaPorts/AmigaC...s/m68k-amigaos Sparhawk: I'll gladly work together with you to make this the ultimate Amiga CMake package, if you'd like. |
12 February 2020, 16:22 | #12 | |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
That would be cool. My toolchain works for me, but I wouldn't be surprised if there is a more elegant approach. My goal was to ideally have only a minimum of setup steps in a cmake project, which means that I want only use find_package() and everything else is automatically properly configured. |
|
12 February 2020, 17:16 | #13 | |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Quote:
My improvements are on all ends in the case of Docker: * Environment variables set for CC, CXX, AR, LD, RANLIB etc, * Aliases for m68k-amigaos-gcc to just gcc etc (so it's like how it would be when compiling directly on Amiga with a Makefile) * using cmake, the m68k-amigaos.cmake toolchain file is preloaded and has all the required variables, so all you need to do is: mkdir build && cd build && cmake .. && make * CMake modules for VASM is preinstalled in the proper directory so enable_language(ASM-VASM) works without extra tinkering What could be improved is how the ASM-VASM files are setup, and adding VBCC as a C/C++ compiler variant. I've sent an invite to be part of AmigaDev/AmigaPorts and granted you access to the AmigaCMakeToolchains repository. |
|
13 February 2020, 13:04 | #14 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
|
13 February 2020, 13:09 | #15 | |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Quote:
https://franke.ms/cex/z/N4LiRl |
|
19 May 2020, 04:04 | #16 | ||
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
Quote:
At the moment I am building (on macOS) via a simple build.shscript but that is obviously not be scalable in the long run. I am not a big CMake fan (to be polite ) but that will be better than nothing. |
||
19 May 2020, 09:01 | #17 |
Registered User
Join Date: Jan 2008
Location: somewhere
Posts: 45
|
I would be interestd in a CLion project too
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GCC/VASM with CMake | sparhawk | Coders. C/C++ | 1 | 20 December 2019 19:10 |
CMake and vasm | sparhawk | Coders. General | 9 | 30 November 2019 21:04 |
[upcoming project] project name hard'n'heavy | Kojote | project.Amiga Game Factory | 0 | 22 March 2018 15:28 |
Natami project freezed, Tina project folded...what next?? | Bamiga2002 | Amiga scene | 52 | 21 May 2014 09:19 |
CMake for WinUAE | gilgamesh | request.UAE Wishlist | 1 | 08 February 2010 00:28 |
|
|