-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ported build system to cmake #19
Conversation
CMakeLists.txt
Outdated
project(Pokopomclion) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_BUILD_TYPE Debug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would setting this to Release make it the default build type on Visual Studio? That would be preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. I'll test it and update the commit if it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per this article https://stackoverflow.com/questions/19024259/how-to-change-the-build-type-to-release-mode-in-cmake, it looks like for Visual Studio you have to specify it when you actually run cmake, like this:
cmake --build ../ --target ALL_BUILD --config Release
I can provide these instructions somewhere if you'd like, or include a batch file. Also, building with the original VS solution file rather than cmake still works if users prefer that.
I really appreciate your help reviewing these changes!
CMakeLists.txt
Outdated
ADD_DEFINITIONS(-DUNICODE) | ||
ADD_DEFINITIONS(-D_UNICODE) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -D_UNICODE -DUNICODE") | ||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really mean it would export all sysmbols? Only those in Exports.def should be exported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, let me look at how to do this with cmake
Build-type is now release, but this only affects makefiles. Visual Studio projects will still have to be modified to release from inside VS. Also specified the symbols file as Exports.def, so only those symbols are exported now.
Thanks again for the review, I've fixed the issues you mentioned in the most recent commit. |
Alright! |
When building Pokopom this way under Arch Linux, I get an unusable plugin, with PCSX2 throwing |
This build makes a 32bit plugin, so unless you use it with a 32bit program, it will fail. |
Sorry to hit you with another PR so soon, but I finished porting the project to optionally use cmake as the build system. Heres how to do it:
cd Pokopom && mkdir build
cmake ../
The cmake command will automatically generate a Visual Studio Solution file or GCC Makefile for you in the build directory, depending on your platform. You can open the solution with Visual Studio and build the library. I am doing all of my Windows 7 testing in a VM and I cannot test how well the plugin works or if I made any mistakes, but I have confirmed that PCSX2 sees the plugin and can configure it normally.