CLion, Embarcadero C++ Builder Set compiler option



I'm configuring CLion to use Embarcadero's BCC32c compiler and have got it compiling a basic file. However, I need to add some include paths to my project. I have tried adding them to my YAML file, and the IDE picks up on the paths and parses the include files in them.

However, it is not passing the extra paths onto the compiler, so the build fails with file not found errors.

So, I go to the CMakeLists.txt file and use the add_compile_options() function, but I can only get it to add one path.

The syntax bcc32 accepts for adding include paths is this:

-I H:\\askins_bcb_11;H:\\chilkat\\include

that is, -I followed by multiple paths separated by a semi colon. However, when I do a build, the semi colon is stripped out of the command and this is sent to the compiler:

bcc32c.exe -tR -DWIN32 -tM -Od -v -I H:\askins_bcb_11 H:\chilkat\include

which does not work. bcc32 picks up the first include path but not the second...

I have tried surrounding the path with quotes or escaping the semi-colon but have not found a way to keep the semi-colon in the build path...

bcc32c also allows multiple -I entries, but if I call add_compile_options() multiple times, the entries are combined into a single -I command, as shown above.

I have also tried this: add_compile_options(-I H:\\askins_bcb_11 -I H:\\chilkat\\include)

but the command passed to the compiler remains -I H:\askins_bcb_11 H:\chilkat\include

Is there a way around this?





1 comment
Comment actions Permalink

Eventually, found the correct syntax:

add_compile_options("SHELL: -I H:/askins_bcb_11" "SHELL: -I H:/chilkat/include")

Please sign in to leave a comment.