Skip to content

Commit

Permalink
change the way of (#define check() and include rpc/server.h), pack fr…
Browse files Browse the repository at this point in the history
…omWin2Linux
  • Loading branch information
9woods123 committed Sep 18, 2024
1 parent d875a23 commit e83681b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
31 changes: 26 additions & 5 deletions AirLib/include/easytrack/easyTrackRpcClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,36 @@
#include "common/common_utils/StrictMode.hpp"
#include "common/Common.hpp"

// STRICT_MODE_OFF
// #undef NOUSER
// #undef FLOAT
// #undef check
// #include "rpc/client.h"
// //TODO: HACK: UE4 defines macro with stupid names like "check" that conflicts with msgpack library
// #ifndef check
// #define check(expr) (static_cast<void>((expr)))
// #endif
// STRICT_MODE_ON

STRICT_MODE_OFF
// 保存当前的宏定义
#pragma push_macro("check")
#pragma push_macro("NOUSER")
#pragma push_macro("FLOAT")

// 取消冲突的宏定义
#undef check
#undef NOUSER
#undef FLOAT
#undef check

// 引入第三方库,避免宏冲突
#include "rpc/client.h"
//TODO: HACK: UE4 defines macro with stupid names like "check" that conflicts with msgpack library
#ifndef check
#define check(expr) (static_cast<void>((expr)))
#endif

// 恢复之前保存的宏定义
#pragma pop_macro("check")
#pragma pop_macro("NOUSER")
#pragma pop_macro("FLOAT")

STRICT_MODE_ON

#include "common/Common.hpp"
Expand Down
21 changes: 16 additions & 5 deletions AirLib/include/easytrack/easyTrackRpcServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,28 @@
#include "common/Common.hpp"

STRICT_MODE_OFF
// 保存当前的宏定义
#pragma push_macro("check")
#pragma push_macro("NOUSER")
#pragma push_macro("FLOAT")

// 取消冲突的宏定义
#undef check
#undef NOUSER
#undef FLOAT
#undef check

// 引入第三方库,避免宏冲突
#include "rpc/server.h"
//TODO: HACK: UE4 defines macro with stupid names like "check" that conflicts with msgpack library
#ifndef check
#define check(expr) (static_cast<void>((expr)))
#endif

// 恢复之前保存的宏定义
#pragma pop_macro("check")
#pragma pop_macro("NOUSER")
#pragma pop_macro("FLOAT")

STRICT_MODE_ON



namespace msr
{
namespace airlib
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To package the simulation software for Linux, you need to convert the `.uproject
```
This will generate a `Block.uproject` that can be opened on Windows. Open the `.uproject` file to let UE4 recompile `Block.uproject`.

5. Return to the AirSim directory and set up the Linux environment:
5. In WSL ubuntu, return to the AirSim directory and set up the Linux environment:
```bash
./setup.sh # Install dependencies for compiling AirSim on Linux
./build.sh # Compile AirSim; this will create an AirSim uproject for Ubuntu
Expand Down
1 change: 0 additions & 1 deletion Unreal/Environments/Blocks/Config/DefaultGame.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ bSkipEditorContent=False
bNativizeBlueprintAssets=False
bNativizeOnlySelectedBlueprints=False


3 changes: 2 additions & 1 deletion Unreal/Plugins/AirSim/Source/AirSim.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ private bool LoadAirSimDependency(ReadOnlyTargetRules Target, string LibName, st
private bool AddLibDependency(string LibName, string LibPath, string LibFileName, ReadOnlyTargetRules Target, bool IsAddLibInclude)
{
string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Mac) ? "x64" : "x86";
string ConfigurationString = (Target.Configuration == UnrealTargetConfiguration.Debug) ? "Debug" : "Release";
string ConfigurationString = (Target.Configuration == UnrealTargetConfiguration.Debug) ? "Debug" :
(Target.Configuration == UnrealTargetConfiguration.Shipping) ? "Shipping" : "Release";
bool isLibrarySupported = false;


Expand Down

0 comments on commit e83681b

Please sign in to comment.