Skip to content

Commit

Permalink
Added config flag 'cppFlags' in order to commit flags to C++ compiler…
Browse files Browse the repository at this point in the history
… in cppRuntime.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25036 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
mflehmig committed Mar 11, 2015
1 parent 3f94931 commit 361b4a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Compiler/Template/CodegenCppHpcom.tpl
Expand Up @@ -1574,13 +1574,16 @@ template simulationMakefile(String target, SimCode simCode, Text& extraFuncs, Te
"Adds specific compiler flags for HPCOM mode to simulation makefile."
::=
let type = getConfigString(HPCOM_CODE)
let cppFlags = getConfigString(CPP_FLAGS)
let &additionalCFlags_GCC = buffer ""
let &additionalCFlags_GCC += if stringEq(type,"openmp") then " -fopenmp" else ""
let &additionalCFlags_GCC += if stringEq(type,"tbb") then ' -I"$(INTEL_TBB_INCLUDE)"' else ""
let &additionalCFlags_GCC += cppFlags + "Blub"
let &additionalCFlags_MSVC = buffer ""
let &additionalCFlags_MSVC += if stringEq(type,"openmp") then "/openmp" else ""
let &additionalCFlags_MSVC += cppFlags
let &additionalLinkerFlags_GCC = buffer ""
let &additionalLinkerFlags_GCC += if stringEq(type,"tbb") then " $(INTEL_TBB_LIBS) " else ""
Expand Down
1 change: 1 addition & 0 deletions Compiler/Template/SimCodeTV.mo
Expand Up @@ -2989,6 +2989,7 @@ package Flags
constant ConfigFlag NUM_PROC;
constant ConfigFlag HPCOM_CODE;
constant ConfigFlag PROFILING_LEVEL;
constant ConfigFlag CPP_FLAGS;

function isSet
input DebugFlag inFlag;
Expand Down
6 changes: 5 additions & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -999,6 +999,9 @@ constant ConfigFlag MAX_SIZE_FOR_SOLVE_LINIEAR_SYSTEM = CONFIG_FLAG(65, "maxSize
NONE(), EXTERNAL(), INT_FLAG(0), NONE(),
Util.gettext("Max size for solveLinearSystem."));

constant ConfigFlag CPP_FLAGS = CONFIG_FLAG(66, "cppFlags",
NONE(), EXTERNAL(), STRING_FLAG(""), NONE(),
Util.gettext("Sets extra flags for compilation with the C++ compiler (e.g. cppFlags='-O3 -Wall')"));

protected
// This is a list of all configuration flags. A flag can not be used unless it's
Expand Down Expand Up @@ -1069,7 +1072,8 @@ constant list<ConfigFlag> allConfigFlags = {
CSE_CALL,
CSE_BINARY,
CSE_EACHCALL,
MAX_SIZE_FOR_SOLVE_LINIEAR_SYSTEM
MAX_SIZE_FOR_SOLVE_LINIEAR_SYSTEM,
CPP_FLAGS
};

public function new
Expand Down

0 comments on commit 361b4a6

Please sign in to comment.