Skip to content

Commit

Permalink
[cmake] use static variable for bridge_helper name
Browse files Browse the repository at this point in the history
  • Loading branch information
sharder996 committed Aug 26, 2024
1 parent c9a3b6a commit 64f0649
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/platform/backends/qemu/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set(BRIDGE_HELPER_EXEC_NAME "bridge_helper")

add_library(qemu_platform_detail
dnsmasq_process_spec.cpp
dnsmasq_server.cpp
firewall_config.cpp
qemu_platform_detail_linux.cpp)

target_compile_definitions(qemu_platform_detail PRIVATE BRIDGE_HELPER_EXEC_NAME_CPP="${BRIDGE_HELPER_EXEC_NAME}")

target_include_directories(qemu_platform_detail PRIVATE ../)

target_link_libraries(qemu_platform_detail
Expand All @@ -27,8 +31,8 @@ target_link_libraries(qemu_platform_detail
utils
Qt6::Core)

add_executable(bridge_helper bridge_helper.c)
add_executable(${BRIDGE_HELPER_EXEC_NAME} bridge_helper.c)

install(TARGETS bridge_helper
install(TARGETS ${BRIDGE_HELPER_EXEC_NAME}
DESTINATION bin
COMPONENT bridge_helper)
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ QStringList mp::QemuPlatformDetail::vm_platform_args(const VirtualMachineDescrip
<< QString::fromStdString(fmt::format("tap,ifname={},script=no,downscript=no,model=virtio-net-pci,mac={}",
tap_device_name, vm_desc.default_mac_address));

const auto bridge_helper_exec_path = QDir(QCoreApplication::applicationDirPath()).filePath("bridge_helper");
const auto bridge_helper_exec_path =
QDir(QCoreApplication::applicationDirPath()).filePath(BRIDGE_HELPER_EXEC_NAME_CPP);

for (const auto& extra_interface : vm_desc.extra_interfaces)
{
Expand Down

0 comments on commit 64f0649

Please sign in to comment.