rolandshacks / vs64

C64 Development Environment for Visual Studio Code
Other
88 stars 15 forks source link

Change resource compiler options to generate c #44

Closed tomaz closed 12 months ago

tomaz commented 1 year ago

Heya! Is it possible to change default rc.py to use --cc instead of --cpp? Using llvm-mos configuration if that matters...

Tried with "resources": "--cc" in project-config.json but it doesn't change anything. Judging from source code this seems to be hard coded?

rolandshacks commented 1 year ago

Thanks for the feedback. Will have a look - next version is around the corner anyways. Good time to ask!

rolandshacks commented 1 year ago

Hi.

Latest release v2.4.1 of vs64 now provides that option.

{
    ...

    "rcFlags": "--format cc"
}

https://github.com/rolandshacks/vs64/releases

Please notice that you have to manually download and install the .vsix as it is not yet published on the vscode marketplace.

tomaz commented 1 year ago

Wow that was fast, thanks!

I tested it, works - parameters are accepted, but rc.py still generates .cpp file (also .o). Also then linker fails for not finding the symbols declared in that file, though the cpp content is correct.

Cmd line without rcFlags:

c:\...\.vscode\extensions\rosc.vs64-2.4.1\resources\python\python.exe 
   c:\...\.vscode\extensions\rosc.vs64-2.4.1\tools\rc.py 
   --config c:\Projects\Test\project-config.json 
   --format cpp 
   -o c:\Projects\Test\build\src\ginger.cpp
   c:\Projects\Test\src\ginger.sid

Cmd line with "rcFlags": "--format cc"

c:\...\.vscode\extensions\rosc.vs64-2.4.1\resources\python\python.exe 
   c:\...\.vscode\extensions\rosc.vs64-2.4.1\tools\rc.py 
   --format cc 
   --config c:\Projects\Test\project-config.json 
   -o c:\Projects\Test\build\src\ginger.cpp
   c:\Projects\Test\src\ginger.sid

I manually put pars into separate lines in both cases for better readability...

Compiler and linker command lines seem fine on quick look. My quick hunch is the compiler sees .cpp and compiles it as such instead of .c which then messes up linker for some reason...

or maybe I'm missing something?

tomaz commented 1 year ago

Maybe it's because project is configured as c++ 🤔 I didn't find a way to set it up as c though...

rolandshacks commented 1 year ago

I think you don't miss anything, my change was not fixing everything 100%... just I didn't have more time :-)

Work on the resource compiler is planned anyways for better audio signal processing, maybe I'll find a smart way to fix the extensions also...

Cheers! Roland

Am Mo., 3. Juli 2023 um 10:35 Uhr schrieb tomaz @.***>:

Wow that was fast, thanks!

I tested it, works - parameters are accepted, but rc.py still generates .cpp file (also .o). Also then linker fails for not finding the symbols declared in that file, though the cpp content is correct.

Cmd line without rcFlags:

c:....vscode\extensions\rosc.vs64-2.4.1\resources\python\python.exe c:....vscode\extensions\rosc.vs64-2.4.1\tools\rc.py --config c:\Projects\Test\project-config.json --format cpp -o c:\Projects\Test

Cmd line with "rcFlags": "--format cc"

c:....vscode\extensions\rosc.vs64-2.4.1\resources\python\python.exe c:....vscode\extensions\rosc.vs64-2.4.1\tools\rc.py --format cc --config c:\Projects\Test\project-config.json -o c:\Projects\Test

I manually put pars into separate lines in both cases for better readability...

maybe I'm missing something?

— Reply to this email directly, view it on GitHub https://github.com/rolandshacks/vs64/issues/44#issuecomment-1617629789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALEIMFDORTIBD57M7CORH3XOJ74VANCNFSM6AAAAAAZZX43HE . You are receiving this because you commented.Message ID: @.***>

tomaz commented 1 year ago

Ok, great to hear. My follow up research seems to point to:

  1. rc.py always generates .cpp file, even if --format cc is given
  2. mos-clang++ is used for compiling/linking instead of mos-clang (maybe this is because it notices a cpp file or maybe it needs to be specified in project-confg.json?)
rolandshacks commented 1 year ago

Update: planned to be fixed/improved. Just need to find some time to finish, test, release.

rolandshacks commented 1 year ago

Release v.2.4.2 is out (to be manually installed from github). Please have a look: https://github.com/rolandshacks/vs64/releases