Author Topic: How i can tell CB that a define name is true or false?  (Read 251 times)

Offline dkaip

  • Multiple posting newcomer
  • *
  • Posts: 29
How i can tell CB that a define name is true or false?
« on: September 22, 2018, 07:24:19 pm »
Hello.
I am trying to find how to set a define name true or false.
Making same libs we put for example ...

is_debug = false
is_component_build = false

If i try to put all sources in C:B how i must put that defines in Build>#defines session?

Thank you.
Jim


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2062
Re: How i can tell CB that a define name is true or false?
« Reply #1 on: September 22, 2018, 10:39:55 pm »
I do not understand your question fully... If the following answer does not solve your problem try to rephrase it, or give a example command line for gcc, or add screenshots..

If you want to add defines to the compiler settings you can add them to
Project->Build options->Select the project name on the left->Compiler->#defines->add

i do not think the preprocessor understands "true" and "false".. i would use "1" and "0"

Offline dkaip

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: How i can tell CB that a define name is true or false?
« Reply #2 on: September 22, 2018, 10:49:29 pm »
For example if i must run a cpp file with pdfium lib, pdfium lib made with ninja and some setting in settings file args.gn like...

Code: [Select]
is_debug = false
pdf_is_standalone = true

How i can put in #define tab if i have all library sources in my project?
Suppose i put like ...
Code: [Select]
is_debug = 0
pdf_is_standalone = 1

In source file we put all that as...

Code: [Select]
#define is_debug false
#define pdf_is_standalone true

Thank you
Jim
« Last Edit: September 22, 2018, 10:52:50 pm by dkaip »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2062
Re: How i can tell CB that a define name is true or false?
« Reply #3 on: September 22, 2018, 11:46:07 pm »
How i can put in #define tab if i have all library sources in my project?
Suppose i put like ...
Code: [Select]
is_debug = 0
pdf_is_standalone = 1
well i assume yes. But if "true" and "false" works in your old build, then it will also work in codeblocks