Skip to content

Commit

Permalink
- duplicated ModelicaLibraryConfig for gcc and msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Walther committed Sep 24, 2015
1 parent ef8b4ae commit 4a959d0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Compiler/Template/CodegenCpp.tpl
Expand Up @@ -3312,6 +3312,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
EXEEXT=.exe
DLLEXT=.dll
include <%makefileParams.omhome%>/include/omc/cpp/ModelicaConfig_msvc.inc
include <%makefileParams.omhome%>/include/omc/cpp/ModelicaLibraryConfig_msvc.inc
# /Od - Optimization disabled
# /EHa enable C++ EH (w/ SEH exceptions)
# /fp:except - consider floating-point exceptions when generating code
Expand Down Expand Up @@ -3384,7 +3385,7 @@ case "gcc" then
# Makefile generated by OpenModelica
OMHOME=<%makefileParams.omhome%>
include $(OMHOME)/include/omc/cpp/ModelicaConfig_gcc.inc
include $(OMHOME)/include/omc/cpp/ModelicaLibraryConfig.inc
include $(OMHOME)/include/omc/cpp/ModelicaLibraryConfig_gcc.inc
# Simulations use -O0 by default
SIM_OR_DYNLOAD_OPT_LEVEL=-O0
CC=<%CC%>
Expand Down
3 changes: 2 additions & 1 deletion Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -675,6 +675,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
EXEEXT=.exe
DLLEXT=.dll
include <%makefileParams.omhome%>/include/omc/cpp/ModelicaConfig_msvc.inc
include <%makefileParams.omhome%>/include/omc/cpp/ModelicaLibraryConfig_msvc.inc
# /Od - Optimization disabled
# /EHa enable C++ EH (w/ SEH exceptions)
# /fp:except - consider floating-point exceptions when generating code
Expand Down Expand Up @@ -730,7 +731,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
# Makefile generated by OpenModelica
OMHOME=<%makefileParams.omhome%>
include $(OMHOME)/include/omc/cpp/ModelicaConfig_gcc.inc
include $(OMHOME)/include/omc/cpp/ModelicaLibraryConfig.inc
include $(OMHOME)/include/omc/cpp/ModelicaLibraryConfig_gcc.inc
# Simulations use -O0 by default; can be changed to e.g. -O2 or -Ofast
SIM_OR_DYNLOAD_OPT_LEVEL=-O0
CC=<%makefileParams.ccompiler%>
Expand Down
24 changes: 16 additions & 8 deletions SimulationRuntime/cpp/Core/Modelica/CMakeLists.txt
Expand Up @@ -225,6 +225,14 @@ IF(MSVC)
install (FILES
${PROJECT_BINARY_DIR}/ModelicaConfig_msvc.inc
DESTINATION include/omc/cpp)

configure_file (
"ModelicaLibraryConfig_msvc.inc.in"
"${PROJECT_BINARY_DIR}/ModelicaLibraryConfig_msvc.inc"
)
install (FILES
${PROJECT_BINARY_DIR}/ModelicaLibraryConfig_msvc.inc
DESTINATION include/omc/cpp)
ENDIF(MSVC)

IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
Expand All @@ -235,15 +243,15 @@ configure_file (
install (FILES
${PROJECT_BINARY_DIR}/ModelicaConfig_gcc.inc
DESTINATION include/omc/cpp)
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

configure_file (
"ModelicaLibraryConfig.inc.in"
"${PROJECT_BINARY_DIR}/ModelicaLibraryConfig.inc"
)
install (FILES
${PROJECT_BINARY_DIR}/ModelicaLibraryConfig.inc
DESTINATION include/omc/cpp)
configure_file (
"ModelicaLibraryConfig_gcc.inc.in"
"${PROJECT_BINARY_DIR}/ModelicaLibraryConfig_gcc.inc"
)
install (FILES
${PROJECT_BINARY_DIR}/ModelicaLibraryConfig_gcc.inc
DESTINATION include/omc/cpp)
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")



Expand Down
@@ -0,0 +1,3 @@
#FMU Libraries
SUNDIALS_LIBRARIES_KINSOL = @SUNDIALS_KINSOL_LIB@
LIBOMCPPKINSOL = "$(OMHOME)/@LIBINSTALLEXT@/lib@KinsolName@$(DLLEXT)"

0 comments on commit 4a959d0

Please sign in to comment.