Jump to content
Sign in to follow this  
lynkfs

command line compiler

Recommended Posts

How do I compile .pas to .js ?

Quote

smsc tryout.pas -output-name=tryout.js

compiles but doesn't produce a tryout.js file

Note :

I can do it in the ide by starting a new project, replace main unit with pas statements, delete all other units, unclick 'use main body' in code generation and unclick everything else in linker options

However the command line compiler would be a better option

Share this post


Link to post
Share on other sites

The syntax is

Usage: smsc [@optionFile] [options] project_name[.sproj|.pas] [options]

  -output-name=<fileName>                 Output file name
  -resource-path=<paths>                  Resource directories
  -unit-path=<paths>                      Unit directories
  -verbosity=none|normal|verbose          Verbosity level
  -hints=disabled|normal|strict|pedantic  Hints level
  -stage=compile|codegen|output           Last compile stage
  -defines=<defines>                      Custom conditional defines
  -search-path=<paths>                    Search path
  -closures=yes|no                        Enable/disable closures
  -code-packing=yes|no                    Enable/disable code packing
  -check-assertions=yes|no                Enable/disable assertion checks
  -check-condition=yes|no                 Enable/disable condition checking
  -check-instance=yes|no                  Enable/disable instance checking
  -check-loop=yes|no                      Enable/disable loop checking
  -check-range=yes|no                     Enable/disable range checking
  -compress-css=yes|no                    Enable/disable CSS compression
  -devirtualization=yes|no                Enable/disable de-virtualization
  -emit-locations=yes|no                  Enable/disable source location
  -emit-cache-manifest=yes|no             Enable/disable app-cache manifest
  -emit-chrome-manifest=yes|no            Enable/disable chrome app manifest
  -emit-source-map=yes|no                 Enable/disable source map
  -inline=yes|no                          Enable/disable code inlining
  -obfuscation=yes|no                     Enable/disable obfuscation
  -optimization=yes|no                    Enable/disable compiler optimization
  -rtti=yes|no                            Enable/disable RTTI
  -smart-linking=yes|no                   Enable/disable smart linking
  -logo=yes|no                            Show/hide logo

I must admit I have not used it much

but out of the box this works for me

smsc "C:\Users\....\MyProjects\window\window.sproj" 
-output-name="C:\Users\....\MyProjects\window\window.js"

or even without the -output-name parameter it compiles and links into whatever is specified in the project file (like '\www\main.js')

Share this post


Link to post
Share on other sites

Thanks, I've tried but it always fails. It works for simple projects (some of demos I've tried) but more complex ones are no go.

Does IDE itself uses smsc to compile? If so perhaps I could intercept somehow what it sends.

 

Share this post


Link to post
Share on other sites

I've just compiled some large regular projects and some based on my own rtl  no problems

so maybe your projects have some special dependencies, or ...

just to be sure, how I tested this :

- navigated to the smsc directory
- opened cmd window
- smsc "G:\SMS3.9.1\Projects\animate5\animate5.sproj"

tested with fully developed projects

(Not sure, but don't think the ide itself uses smsc)

Share this post


Link to post
Share on other sites

The IDE does not use smsc.exe to compile. However, it uses the same source code for the compiler. AFAIK, you should be able to compile all the complex projects also with the command line compiler. If you have trouble with that, make sure that you are using the right compiler. If you have several versions of SMS installed, it may be that you run an older version of smsc.exe du to it being in your path. If that doesn't help, you can zip the project and e-mail it to me (jt at smartmobilestudio.com) and I'll have a look where the problem is.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...