Thunks: Fix definition of GUEST_THUNK_LIBRARY

The -deps target is the wrong target to add this to, since its compile flags
are propagated to both Guest.cpp and Host.cpp. Instead, define the flag only
when processing files within a guest context.
This commit is contained in:
Tony Wasserka committed 2024-01-19 11:17:44 +01:00
1 parent acf48e29b2
commit b08d372c78
3 files changed
+3 -1

No files matched your search

+1
View File
@@ -77,6 +77,7 @@ int main(int argc, char* const argv[]) {
AdjustedArgs.push_back(std::string { "--target=" } + platform + "-linux-unknown");
AdjustedArgs.push_back("-isystem");
AdjustedArgs.push_back(std::string { "/usr/" } + platform + "-linux-gnu/include/");
AdjustedArgs.push_back("-DGUEST_THUNK_LIBRARY");
return AdjustedArgs;
};
GuestTool.appendArgumentsAdjuster(append_guest_args);
-1
View File
@@ -51,7 +51,6 @@ function(generate NAME SOURCE_FILE)
# Interface target for the user to add include directories
add_library(${NAME}-guest-deps INTERFACE)
target_include_directories(${NAME}-guest-deps INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/../include")
target_compile_definitions(${NAME}-guest-deps INTERFACE GUEST_THUNK_LIBRARY)
if (BITNESS EQUAL 32)
target_compile_definitions(${NAME}-guest-deps INTERFACE IS_32BIT_THUNK)
endif ()
@@ -1,3 +1,5 @@
#define GUEST_THUNK_LIBRARY
#include <dlfcn.h>
#include <stdexcept>