Author Topic: is $if(){}{} broken in svn 7121?  (Read 3337 times)

Offline ouch

  • Almost regular
  • **
  • Posts: 223
is $if(){}{} broken in svn 7121?
« on: April 23, 2011, 12:03:12 am »
it hides the $if part but passes the rest to the command lines...

going by the wiki it says:

$if(condition){true clause}{false clause}

located at the bottom of:

http://wiki.codeblocks.org/index.php?title=Variable_expansion

has the context changed or something?

running win 7

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: is $if(){}{} broken in svn 7121?
« Reply #1 on: April 25, 2011, 12:52:04 am »
Can someone at least try it and see if it works for you with what ever version you have? It's breaking my build process and to fix it I have to do a lot of manual configuring.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: is $if(){}{} broken in svn 7121?
« Reply #2 on: April 25, 2011, 04:50:23 am »
I do not use the feature; but, I see no difference in how it worked for me between 10.05 and current SVN build. Tested in pre-build step.

If you want something done, post how to duplicate the problem.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: is $if(){}{} broken in svn 7121?
« Reply #3 on: April 25, 2011, 05:05:06 pm »
really? it works for you?

maybe I'm using it wrong then.

in my link libraries I have this:

libSQLite3_$if($(SQLite3Ver)){$(SQLite3Ver)}{$(#sqlite3.ver)}

SQLite3Ver is created but undefined.

sqlite3.ver is equal to 3070602 (defined in global variables)

The output looks like this:

-lSQLite3_(){}{3070602}

That's not right is it? or am I placing it somewhere I shouldn't?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: is $if(){}{} broken in svn 7121?
« Reply #4 on: April 25, 2011, 05:40:12 pm »
Your use is much more complex than mine. You might try using a defined/constant value as the test.
I use 1==1 in a pre-step and it looked like it worked.
No idea if it works in the Library name area.

Edit: Tried below and it looked like it worked OK in the library name list.

Code
libSQLite3_$if(%SQLite3Ver%){$(SQLite3Ver)}{$(#sqlite3.ver)}

Tim S.
« Last Edit: April 25, 2011, 05:56:18 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: is $if(){}{} broken in svn 7121?
« Reply #5 on: April 25, 2011, 05:57:02 pm »
indeed, seems like it doesn't like variable declared like $(var) in the conditional section. Maybe it interferes with the parenthesis of the the if declaration?

should be added to the wiki (or even better, fixed...) if it turns out to be so.

thanks for your time!

edit:
omg! this rocks so hard! I had multiple global vars defined for each version of the library used. Now I have one for each library with a default version defined to use. This can be overridden in the project root's custom var section. just enter in the version you want to use and everything just works. I love it!
« Last Edit: April 25, 2011, 06:17:30 pm by ouch »