Changeset 6f81d96 in OpenModelica


Ignore:
Timestamp:
2020-10-21T14:04:15+02:00 (3 years ago)
Author:
Mahder Gebremedhin <mahder.gebremedhin@…>
Children:
b5b95099
Parents:
27124b2
git-author:
Mahder Gebremedhin <mahder.gebremedhin@…> (07/12/20 20:34:30)
git-committer:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/21/20 14:04:15)
Message:

[cmake] Clarify BootstrappingHeader inclusion.

  • We include OpenModelicaBootstrappingHeader.h with a relative path now.
  • If OMC_BOOTSTRAPPING is defined it is included from Compiler/boot/tarball-include. Otherwise include it from Compiler/.

We can, of course, give OMCompiler/Compiler dir as an include directory to
the libraries in runtime.
However, there is an omc_fil.h in Compiler/Util (it should not be there but it is there for now)
there is also an omc_file.h in SimulationRuntime/c/util.

We link to OpenModelicaRuntime which is built in SimulationRuntime/c/ and we
automatically provide SimulationRuntime/c/ as an include dir for things that link
to this library. This means for example runtime/omcruntime.a will get SimulationRuntime/c/
as an include dir automatically when linking to OpenModelicaRuntime.

If we give both Compiler/ and SimulationRuntime/c/ we essentially have two
files that can be reached as #include "util/omc_file.h". We should try to avoid
manually adding target_include dirs anyway. for this reason OMCompiler/Compiler/ is
not given as an include dir now. It was only needed for OpenModelicaBootstrappingHeader.h.
OpenModelicaBootstrappingHeader.h is now included by relative path.

Location:
OMCompiler
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/runtime/CMakeLists.txt

    r27124b2 r6f81d96  
    2222target_link_libraries(omcruntime PUBLIC Intl)
    2323target_link_libraries(omcruntime PUBLIC iconv)
     24target_link_libraries(omcruntime PUBLIC OpenModelicaRuntimeC)
    2425target_link_libraries(omcruntime PUBLIC omc::3rd::lpsolve55)
    25 target_link_libraries(omcruntime PUBLIC OpenModelicaRuntimeC)
    2626target_link_libraries(omcruntime PUBLIC omc::3rd::libzmq)
    2727target_link_libraries(omcruntime PUBLIC omc::3rd::FMIL::minizip) # We use the minizip lib from 3rdParty/FMIL
    2828# target_link_libraries(omcruntime PUBLIC omc::3rd::gc)
    2929
    30 target_include_directories(omcruntime PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
    31 
    32 target_include_directories(omcruntime PRIVATE ${SimulationRuntimeC_SOURCE_DIR}) #for openmodelica.h :/
    3330target_include_directories(omcruntime PRIVATE ${OMCompiler_SOURCE_DIR}) #for revision.h
    34 
    35 target_include_directories(omcruntime PRIVATE ${OMCompiler_SOURCE_DIR}/Compiler) #for OpenModelicaBootstrappingHeader.h :/
    3631
    3732
     
    4540add_library(omcbackendruntime STATIC ${OMC_BACKENDRUNTIIME_SOURCES})
    4641add_library(omc::compiler::backendruntime ALIAS omcbackendruntime)
    47 # target_compile_features(omcbackendruntime PRIVATE cxx_std_11)
    4842
    4943target_link_libraries(omcbackendruntime PUBLIC OpenModelicaRuntimeC)
     
    5145target_link_libraries(omcbackendruntime PUBLIC omc::3rd::gc)
    5246
    53 
    54 target_include_directories(omcbackendruntime PRIVATE ${SimulationRuntimeC_SOURCE_DIR}) #for openmodelica.h :/
    5547target_include_directories(omcbackendruntime PRIVATE ${OMCompiler_SOURCE_DIR}) #for revision.h
    56 target_include_directories(omcbackendruntime PRIVATE ${OMCompiler_SOURCE_DIR}/Compiler) #for OpenModelicaBootstrappingHeader.h :/
    57 
    58 
    59 
    6048
    6149
     
    6654add_library(omcgraphstream STATIC ${OMC_GRAPH_STREAM_SOURCES})
    6755add_library(omc::compiler::graphstream ALIAS omcgraphstream)
    68 # target_compile_features(omcbackendruntime PRIVATE cxx_std_11)
    6956
    7057target_link_libraries(omcgraphstream PUBLIC OpenModelicaRuntimeC)
    7158target_link_libraries(omcgraphstream PUBLIC omc::3rd::netstream)
    72 # target_link_libraries(omcbackendruntime PUBLIC omc::3rd::fmilib::shared) # We use the minizip lib from 3rdParty/FMIL
    73 # target_link_libraries(omcbackendruntime PUBLIC omc::3rd::gc)
    74 
    75 
    76 # target_include_directories(omcbackendruntime PRIVATE ${SimulationRuntimeC_SOURCE_DIR}) #for openmodelica.h :/
    77 # target_include_directories(omcbackendruntime PRIVATE ${OMCompiler_SOURCE_DIR}) #for revision.h
    78 target_include_directories(omcgraphstream PRIVATE ${OMCompiler_SOURCE_DIR}/Compiler) #for OpenModelicaBootstrappingHeader.h :/
  • OMCompiler/Compiler/runtime/Dynload_omc.cpp

    rc251417 r6f81d96  
    3939#include "openmodelica.h"
    4040#include "meta/meta_modelica.h"
     41
    4142#define ADD_METARECORD_DEFINITIONS static
    42 #include "OpenModelicaBootstrappingHeader.h"
     43#if defined(OMC_BOOTSTRAPPING)
     44  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     45#else
     46  #include "../OpenModelicaBootstrappingHeader.h"
     47#endif
     48
    4349#include "Dynload.cpp"
    4450#include "ModelicaUtilities.h"
  • OMCompiler/Compiler/runtime/Error_omc.cpp

    rdf6240e r6f81d96  
    3535#include "meta/meta_modelica.h"
    3636#include "util/modelica_string.h"
     37
    3738#define ADD_METARECORD_DEFINITIONS static
    38 #include "OpenModelicaBootstrappingHeader.h"
     39#if defined(OMC_BOOTSTRAPPING)
     40  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     41#else
     42  #include "../OpenModelicaBootstrappingHeader.h"
     43#endif
     44
    3945#include "util/ModelicaUtilitiesExtra.h"
    4046
  • OMCompiler/Compiler/runtime/FMI_omc.c

    rc251417 r6f81d96  
    3030
    3131#include "meta/meta_modelica.h"
     32
    3233#define ADD_METARECORD_DEFINITIONS static
    33 #include "OpenModelicaBootstrappingHeader.h"
     34#if defined(OMC_BOOTSTRAPPING)
     35  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     36#else
     37  #include "../OpenModelicaBootstrappingHeader.h"
     38
     39#endif
     40
    3441#include "FMIImpl.c"
  • OMCompiler/Compiler/runtime/GraphStreamExt_omc.cpp

    r27124b2 r6f81d96  
    3838extern "C" {
    3939#include "meta/meta_modelica.h"
     40
    4041#define ADD_METARECORD_DEFINITIONS static
    41 #include "OpenModelicaBootstrappingHeader.h"
     42#if defined(OMC_BOOTSTRAPPING)
     43  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     44#else
     45  #include "../OpenModelicaBootstrappingHeader.h"
     46#endif
    4247}
    4348
  • OMCompiler/Compiler/runtime/HpcOmBenchmarkExt_omc.cpp

    rc251417 r6f81d96  
    11#include "openmodelica.h"
    22#include "meta/meta_modelica.h"
     3
    34#define ADD_METARECORD_DEFINITIONS static
    4 #include "OpenModelicaBootstrappingHeader.h"
     5#if defined(OMC_BOOTSTRAPPING)
     6  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     7#else
     8  #include "../OpenModelicaBootstrappingHeader.h"
     9#endif
     10
    511
    612#if !defined(_MSC_VER)
  • OMCompiler/Compiler/runtime/HpcOmSchedulerExt_omc.cpp

    rc251417 r6f81d96  
    11#include "openmodelica.h"
    22#include "meta/meta_modelica.h"
     3
    34#define ADD_METARECORD_DEFINITIONS static
    4 #include "OpenModelicaBootstrappingHeader.h"
     5#if defined(OMC_BOOTSTRAPPING)
     6  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     7#else
     8  #include "../OpenModelicaBootstrappingHeader.h"
     9#endif
    510
    611#if !defined(_MSC_VER)
  • OMCompiler/Compiler/runtime/SimulationResults_omc.c

    rb9156e9 r6f81d96  
    3939
    4040#include "meta/meta_modelica.h"
     41
    4142#define ADD_METARECORD_DEFINITIONS static
    42 #include "OpenModelicaBootstrappingHeader.h"
     43#if defined(OMC_BOOTSTRAPPING)
     44  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     45#else
     46  #include "../OpenModelicaBootstrappingHeader.h"
     47#endif
    4348
    4449#include "SimulationResults.c"
  • OMCompiler/Compiler/runtime/System_omc.c

    rb9156e9 r6f81d96  
    5151#include "meta/meta_modelica.h"
    5252#include "ModelicaUtilities.h"
     53
    5354#define ADD_METARECORD_DEFINITIONS static
    54 #include "OpenModelicaBootstrappingHeader.h"
     55#if defined(OMC_BOOTSTRAPPING)
     56  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     57#else
     58  #include "../OpenModelicaBootstrappingHeader.h"
     59#endif
     60
    5561#include "systemimpl.c"
    5662
  • OMCompiler/Compiler/runtime/TaskGraphResults_omc.cpp

    rc251417 r6f81d96  
    33#include "openmodelica.h"
    44#include "meta/meta_modelica.h"
     5
    56#define ADD_METARECORD_DEFINITIONS static
    6 #include "OpenModelicaBootstrappingHeader.h"
     7#if defined(OMC_BOOTSTRAPPING)
     8  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     9#else
     10  #include "../OpenModelicaBootstrappingHeader.h"
     11#endif
    712}
     13
    814#include "TaskGraphResultsCmp.cpp"
    915#else
  • OMCompiler/Compiler/runtime/ptolemyio_omc.cpp

    rb9156e9 r6f81d96  
    3131extern "C" {
    3232#include "meta/meta_modelica.h"
     33
    3334#define ADD_METARECORD_DEFINITIONS static
    34 #include "OpenModelicaBootstrappingHeader.h"
     35#if defined(OMC_BOOTSTRAPPING)
     36  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     37#else
     38  #include "../OpenModelicaBootstrappingHeader.h"
     39#endif
     40
    3541}
    3642#include "ptolemyio.cpp"
  • OMCompiler/Compiler/runtime/settingsimpl.c

    rc69955d r6f81d96  
    3535#include <assert.h>
    3636#include "omc_config.h"
    37 #include "OpenModelicaBootstrappingHeader.h"
     37
     38#if defined(OMC_BOOTSTRAPPING)
     39  #include "../boot/tarball-include/OpenModelicaBootstrappingHeader.h"
     40#else
     41  #include "../OpenModelicaBootstrappingHeader.h"
     42#endif
    3843
    3944#if defined(_MSC_VER) || defined(__MINGW32__)
  • OMCompiler/SimulationRuntime/c/CMakeLists.txt

    r0476685a r6f81d96  
    2828# target_link_libraries(OpenModelicaRuntimeC PUBLIC $<$<CXX_COMPILER_ID:gcc>:dbghelp>)
    2929
     30target_include_directories(OpenModelicaRuntimeC PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
     31
    3032
    3133
Note: See TracChangeset for help on using the changeset viewer.