Changeset 7f25d743 in OpenModelica


Ignore:
Timestamp:
2020-10-21T14:04:17+02:00 (3 years ago)
Author:
Mahder Gebremedhin <mahder.gebremedhin@…>
Children:
fc194da
Parents:
ad2dc198
git-author:
Mahder Gebremedhin <mahder.gebremedhin@…> (09/18/20 10:31:28)
git-committer:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/21/20 14:04:17)
Message:

[cmake] Add missing MM dependency updater.

  • If a MM source is modfied and its interface has changed then the MM source files that depend on it need to be retranslated.

There is a tiny cmake script added to instigate this. It reads the
reverse dependencies (dependees) of the modified MM file and touches
their "stamps" so that they get translated again.

Note right now they are not checked for interface "change". There might
be a need to have this, but we will see if it is so as we go.

This was left for later while I fix the other CMake issues.

Location:
OMCompiler
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/CMakeLists.txt

    r780c1e84 r7f25d743  
    22project(OMCompiler)
    33
     4# Variable for signifying that we are using the new CMake configuration.
    45# We use this to selectively include some cmake source files
    56# e.g. simulationRuntime/c/ has two cmake sources that are conditionally
     
    2728omc_add_subdirectory(3rdParty)
    2829
    29 # We want to make sure include directories are handled properly. C allows implicit function
    30 # declaration. We have to disable that so that we can be consistent and correct with our inclusions.
     30# We do this after 3rdPart is added because some libs in FMILib use implicit function declration
     31# because of missing #defines due to bad configuration.
     32
     33# We want to make sure include directories are handled properly.
     34# We have to disable implicit function declaration so that we can be consistent and correct with our inclusions.
    3135if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    3236    add_compile_options($<$<COMPILE_LANGUAGE:C>:-Werror=implicit-function-declaration>)
  • OMCompiler/Compiler/.cmake/dep_scanner.cpp

    rf922c1f r7f25d743  
    7777        }
    7878
    79         rev_dep_file << pac.first << ": ";
     79        // rev_dep_file << pac.first << ": ";
    8080        for (const auto& depee : pac.second) {
    81             rev_dep_file << depee << " ";
     81            rev_dep_file << depee << ";";
    8282        }
    83         rev_dep_file << std::endl;
     83        // rev_dep_file << std::endl;
    8484
    8585        // if(pac.second.size() > largest) {
  • OMCompiler/Compiler/CMakeLists.txt

    r76fcdf3 r7f25d743  
    6464        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.interface.mo
    6565        # COMMAND ${CMAKE_COMMAND} -E cat ${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.rev_depends
     66        COMMAND ${CMAKE_COMMAND} -DREV_DEP_FILE=${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.rev_depends
     67                                 -DINTERFACE_FILES_DIR=${CMAKE_CURRENT_BINARY_DIR}
     68                                  -P ${CMAKE_CURRENT_SOURCE_DIR}//.cmake/dep_toucher.cmake
    6669        COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.rev_deps.stamp
    6770        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.rev_deps.stamp
    68         COMMENT "Touched dependents of ${mo_source_file}"
     71        COMMENT "Touching dependents of ${mo_source_file}"
    6972    )
    7073    set(OMC_REV_DEP_STAMP_FILES ${OMC_REV_DEP_STAMP_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.rev_deps.stamp)
     
    138141add_custom_target(DEPENDENCY_UPDATE
    139142                  DEPENDS ${OMC_REV_DEP_STAMP_FILES}
    140                   COMMENT "Updated dependencies for MetaModelica sources.")
     143                  COMMENT "Touched dependents of modified MetaModelica sources.")
    141144
    142145
Note: See TracChangeset for help on using the changeset viewer.