Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: dkaip on September 22, 2018, 07:24:19 pm

Title: How i can tell CB that a define name is true or false?
Post by: dkaip 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

Title: Re: How i can tell CB that a define name is true or false?
Post by: BlueHazzard 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"
Title: Re: How i can tell CB that a define name is true or false?
Post by: dkaip 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
Title: Re: How i can tell CB that a define name is true or false?
Post by: BlueHazzard 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