CMake fixes to support Windows builds.#1
CMake fixes to support Windows builds.#1miishuistr wants to merge 6 commits intobitdefender:masterfrom miishuistr:master
Conversation
* [Execution, SymbolicEnvironment] Correct _cdecl adn _stdcall definitions * [VirtualMemory] Renamed structure MemoryRegionInfo so it doesn't collide with enum value * [revtracer-wrapper] Added compile time definition Everything compiles now on windows!
* [BinLoader] added Extern.Mapper.cpp and Mem.Mapper.cpp to cmake. * [Execution, loader, revtracer-wrapper] Specified OS-dependant libs. * [Execution] Removed redundant ifdef in Main.cpp
CMakeLists.txt
Outdated
| @@ -1,8 +1,14 @@ | |||
| cmake_minimum_required(VERSION 2.8) | |||
| set(CMAKE_SYSTEM_NAME Linux) | |||
| cmake_minimum_required(VERSION 3.7) | |||
There was a problem hiding this comment.
Ubuntu supports cmake 3.5 in the official repositories. What is the reason behind 3.7? We need to upgrade all the machines with RIVER for this change otherwise.
There was a problem hiding this comment.
Removed the requirement for cmake 3.7. I strongly suggest setting a DESTDIR when running cmake since the default DESTDIR for Windows is %programfiles%.
|
|
||
| set(LIBRARY_NAME execution) | ||
| set(FLAGS_CROSS "-D__cdecl=\"\" -D__stdcall=\"\"") | ||
| if(WIN32) |
There was a problem hiding this comment.
Not sure if this if statement sets the previous version on LINUX and your version on WIN
There was a problem hiding this comment.
I find it weird that calling conventions get smashed on linux. Are you sure this is your intention?
There was a problem hiding this comment.
It should work with __attribute__((stdcall)) and __attribute__((cdecl)). But I see the definition is for _cdecl and _stdcall. The previous code uses __stdcall and __cdecl. Check for example revtracer/revtracer.h:70
|
These changes can help us extend the tracer functionality on Windows. Very good initiative. I have few extra comments:
|
Quickly documented Windows build steps
|
|
Windows build worked. Please disable |
|
The next actions points are:
|
I found the CMake suppport for Windows lacking, and I decided to try to improve it. Please let me know what additional modifications I need to make for a reliable windows+cmake build