Skip to content

Commit e4d30ad

Browse files
committed
🚸 Portability improvements for the QIR runner (#1410)
## Description Picked from #1403. Improves the portability of the QIR runner by relying on less platform specific functions. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are focused and relevant to this change. - [x] I have added appropriate tests that cover the new/changed functionality. - [x] I have updated the documentation to reflect these changes. - [x] I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. - [x] I have added migration instructions to the upgrade guide (if needed). - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. --------- Signed-off-by: burgholzer <burgholzer@me.com> (cherry picked from commit 3bef3a6)
1 parent 8d53be1 commit e4d30ad

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

test/qir/runner/test_qir_runner.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
#include <gtest/gtest.h>
1414
#include <sstream>
1515

16-
#ifdef _WIN32
17-
#define SYSTEM _wsystem
18-
#else
19-
#define SYSTEM std::system
20-
#endif
21-
2216
namespace qir {
2317
class QIRRunnerTest : public testing::TestWithParam<std::filesystem::path> {};
2418

@@ -37,8 +31,8 @@ INSTANTIATE_TEST_SUITE_P(
3731
TEST_P(QIRRunnerTest, QIRFile) {
3832
const auto& file = GetParam();
3933
std::ostringstream command;
40-
command << EXECUTABLE_PATH << " " << file;
41-
const auto result = SYSTEM(command.str().c_str());
34+
command << "\"" << EXECUTABLE_PATH << "\" \"" << file << "\"";
35+
const auto result = std::system(command.str().c_str());
4236
EXPECT_EQ(result, 0);
4337
}
4438
} // namespace qir

test/qir/runtime/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ macro(ADD_QIR_CIRCUIT target_name circuit_path)
2121
COMMENT "Compiling ${circuit_path} to ${circuit_name}.o")
2222
add_executable(${target_name} ${circuit_name}.o)
2323
target_link_libraries(${target_name} PRIVATE MQT::CoreQIRRuntime)
24+
set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE CXX)
2425
endif()
2526
endmacro()
2627

0 commit comments

Comments
 (0)