diff --git a/libs/libvtrutil/cmake/modules/configure_version.cmake b/libs/libvtrutil/cmake/modules/configure_version.cmake index 8c7fbf17ed9..ab944548080 100644 --- a/libs/libvtrutil/cmake/modules/configure_version.cmake +++ b/libs/libvtrutil/cmake/modules/configure_version.cmake @@ -4,10 +4,11 @@ #Figure out the git revision find_package(Git QUIET) if(GIT_FOUND) - exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} - ARGS describe --always --long --dirty - OUTPUT_VARIABLE VTR_VCS_REVISION - RETURN_VALUE GIT_DESCRIBE_RETURN_VALUE) + execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE VTR_VCS_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE GIT_DESCRIBE_RETURN_VALUE) if(NOT GIT_DESCRIBE_RETURN_VALUE EQUAL 0) #Git describe failed, usually this means we @@ -18,10 +19,12 @@ if(GIT_FOUND) #Call again with exclude to get the revision excluding any tags #(i.e. just the commit ID and dirty flag) - exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} - ARGS describe --always --long --dirty --exclude '*' - OUTPUT_VARIABLE VTR_VCS_REVISION_SHORT - RETURN_VALUE GIT_DESCRIBE_RETURN_VALUE) + execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty --exclude '*' + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE VTR_VCS_REVISION_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE GIT_DESCRIBE_RETURN_VALUE) + if(NOT GIT_DESCRIBE_RETURN_VALUE EQUAL 0) #Git describe failed, usually this means we #aren't in a git repo -- so don't set a VCS diff --git a/vpr/src/route/router_lookahead_extended_map.cpp b/vpr/src/route/router_lookahead_extended_map.cpp index db71adc6a8d..6db4c4ff7bc 100644 --- a/vpr/src/route/router_lookahead_extended_map.cpp +++ b/vpr/src/route/router_lookahead_extended_map.cpp @@ -604,26 +604,25 @@ float ExtendedMapLookahead::get_expected_cost( } } -#ifndef VTR_ENABLE_CAPNPROTO - -void ExtendedMapLookahead::read(const std::string& file) { - VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented"); -} -void ExtendedMapLookahead::write(const std::string& file) const { - VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented"); -} - -#else - void ExtendedMapLookahead::read(const std::string& file) { +#ifndef VTR_ENABLE_CAPNPROTO cost_map_.read(file); this->src_opin_delays = util::compute_router_src_opin_lookahead(is_flat_); this->chan_ipins_delays = util::compute_router_chan_ipin_lookahead(); +#else // VTR_ENABLE_CAPNPROTO + (void)file; + VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented"); +#endif // VTR_ENABLE_CAPNPROTO } + void ExtendedMapLookahead::write(const std::string& file) const { +#ifndef VTR_ENABLE_CAPNPROTO cost_map_.write(file); +#else // VTR_ENABLE_CAPNPROTO + (void)file; + VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented"); +#endif // VTR_ENABLE_CAPNPROTO } -#endif