Changeset 88b5250f in OpenModelica
- Timestamp:
- 2020-10-21T14:04:18+02:00 (4 years ago)
- Children:
- ea3c8823
- Parents:
- d0e20bb
- git-author:
- Mahder Gebremedhin <mahder.gebremedhin@…> (10/15/20 10:41:05)
- git-committer:
- Mahder Gebremedhin <mahder.gebremedhin@…> (10/21/20 14:04:18)
- Location:
- OMCompiler/Compiler
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/CMakeLists.txt
r577c0c0b r88b5250f 30 30 31 31 32 add_executable(dep_scanner ${CMAKE_CURRENT_SOURCE_DIR}/.cmake/dep_scanner.cpp)33 target_compile_features(dep_scanner PRIVATE cxx_std_11)34 35 36 37 38 39 32 40 33 macro(add_interface_check_step mo_source_file) … … 55 48 ) 56 49 57 set(OMC_MM_SOURCE_FILE S ${OMC_MM_SOURCE_FILES} ${mo_source_file})50 set(OMC_MM_SOURCE_FILE_NAMES ${OMC_MM_SOURCE_FILE_NAMES} ${file_name_no_ext}) 58 51 59 52 set(OMC_MM_INTERFACE_FILES ${OMC_MM_INTERFACE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${file_name_no_ext}.interface.mo) … … 124 117 125 118 119 120 # A target to make sure all interfaces have been checked. Interfaces get rechecked if a MM source is 121 # modified. If a source is modified and the interface has NOT actually changed then only the stamp files 122 # are touched to signify time of check. If the interface has CHANGED then the interface file is also 123 # updated which will cause regeneration of dependency information. See the section below. 126 124 add_custom_target(INTERFACE_CHECK 127 125 DEPENDS ${OMC_MM_STAMP_FILES} 128 126 COMMENT "Checked interfaces of modified MetaModelica sources.") 129 127 128 129 130 131 # Add a small dependency scanner program. This reads a list of list of dependencies and generates 132 # a list of dependents for each entry. 133 add_executable(dep_scanner ${CMAKE_CURRENT_SOURCE_DIR}/.cmake/dep_scanner.cpp) 134 target_compile_features(dep_scanner PRIVATE cxx_std_11) 135 136 # Write out a new line separated list of all MM source files to a list so that it can be easily 137 # parsed by the small MetaModelica dependency scanner we have now. (c++ code) 138 # The quote "" on ${OMC_MM_SOURCE_FILE_NAMES} is needed to get the ";"s in the list 139 string (REPLACE ";" "\n" OMC_MM_SOURCE_FILE_NAMES_NEW_LINES "${OMC_MM_SOURCE_FILE_NAMES}") 140 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/mm_source_filenames_list.txt ${OMC_MM_SOURCE_FILE_NAMES_NEW_LINES}) 141 142 # Read the mm_source_filenames_list with the dep scanner. The dep scanner then reads <mm_source>.depends file for the 143 # each mm_source in the list and generates the "reverse dependencies" (dependents) for each source in to <mm_source>.rev_deps. 144 # This means all the files listed in .rev_deps need to be retranslated when <mm_source>.mo is modified. 130 145 add_custom_command( 131 146 DEPENDS ${OMC_MM_INTERFACE_FILES} 132 COMMAND $<TARGET_FILE:dep_scanner> ${CMAKE_CURRENT_ SOURCE_DIR}/.cmake/package_list.txt ${CMAKE_CURRENT_BINARY_DIR}147 COMMAND $<TARGET_FILE:dep_scanner> ${CMAKE_CURRENT_BINARY_DIR}/mm_source_filenames_list.txt ${CMAKE_CURRENT_BINARY_DIR} 133 148 COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/dep_scan.stamp 134 149 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dep_scan.stamp … … 139 154 140 155 156 157 158 141 159 add_custom_target(DEPENDENCY_UPDATE 142 160 DEPENDS ${OMC_REV_DEP_STAMP_FILES} … … 147 165 add_dependencies(DEPENDENCY_UPDATE DEPENDENCY_SCAN) 148 166 167 168 169 149 170 add_library(OpenModelicaCompiler STATIC ${OMC_C_SOURCE_FILES} .cmake/omc_entry_point.c) 150 171 target_compile_definitions(OpenModelicaCompiler PRIVATE ADD_METARECORD_DEFINITIONS=) … … 153 174 154 175 155 include_regular_expression("^$")156 176 # There is a lonely omc_file.h in Util/. It belongs in runtime/. Remove this when it is moved. 157 177 target_include_directories(OpenModelicaCompiler PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Util) 158 159 # include_regular_expression("^.*$" "^$")160 178 161 179
Note: See TracChangeset
for help on using the changeset viewer.