User forums > Using Code::Blocks
How to send the compiler options to a .bat file via Tools
edison:
I have try to create a Tools item like this:
--- Code: ---$(CODEBLOCKS)\test.bat [[CompileOptionsBase().GetCompilerOptions();]]
--- End code ---
and the content of test.bat is:
--- Code: ---@echo off @echo %1
--- End code ---
But the pop-up window does not show the compiler options but just say "echo is off".
I want the compiler options is because I am trying to create a clang-check item in Tools, clang-check need to know the current compiler options.
So, is there any way to do this?
stahta01:
Could NOT get yours to work; but, this did using the ToolPlus Plugin
Edit: Just got the echo message like you did with your command.
--- Code: ---$(CODEBLOCKS)\test.bat [[ print(GetProjectManager().GetActiveProject().GetTitle()); ]]
--- End code ---
Tim S.
edison:
--- Code: ---$(CODEBLOCKS)\test.bat "[[ print(CompileOptionsBase().GetCompilerOptions()); ]]"
--- End code ---
This time I got:
--- Quote ---"(null : 0x00000000)"
--- End quote ---
Does CompileOptionsBase().GetCompilerOptions() work in my case ?
stahta01:
Likely you are doing something wrong.
Edit: As in you are using the wrong script command(s); I really have no idea what the right script command would be.
Edit2: I think it is likely you need to use GetStringFromArray in order to convert the compiler options into a thing usable by print; but, this is just a guess.
Please state what compiler options you wish to have in the output?
Global, Project, or Target?
Tim S.
edison:
If possible, I think it is better send all options to the .bat.
If the script can grap only one type option, I can use 3 scripts to send 3 type option as 3 parameters to .bat.
Navigation
[0] Message Index
[#] Next page
Go to full version