Skip to content
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

Some fixes for MSVC. #70

Merged
merged 9 commits into from Feb 11, 2017
Merged

Some fixes for MSVC. #70

merged 9 commits into from Feb 11, 2017

Conversation

@edorax
Copy link
Contributor

edorax commented Feb 11, 2017

Tested for VS2012 & MXE.

Copy link
Contributor

ZachBacon left a comment

the line that has ../../dependencies should be top level cmake and use ./dependencies/msvc instead.

edorax and others added 5 commits Feb 11, 2017
Add -std=gnu+11 to CMAKE_CXX_COMPILE_OBJECT in the main CMakeLists.txt
to force the option for all C++ sources.

The right way to do this is to use a generator expression with
ADD_COMPILE_OPTIONS, but this is only available in cmake 3.3 and we must
maintain 2.8.12 compatibility to support Ubuntu 14.

This fixes the mac build (clang.)
Also quote LOCALEDIR with as \\\""${LOCALEDIR}"\\\", just like the other
defs are quoted.

This fixes the build on msys2.
@rkitover

This comment has been minimized.

Copy link
Collaborator

rkitover commented Feb 11, 2017

I added a couple of tiny fixes, other than that 👍 from me!

I was going to look at fixing VS cmake generation at some point, so thank you very much for doing this!

I had some questions, since I have only used VS a couple of times before, how do you build a cmake project such as this in VS? Do you download the mingw tarballs for the deps and use the cmake GUI to set paths to them, or some other way? Can we automate this (perhaps by including everything in the dependencies submodule?)

I was going to play with this, essentially full free VS:

https://www.visualstudio.com/vs/community/

Move the check for dependencies/msvc into the previous IF(WIN32) block
adding an IF(MSVC) level.

Remove duplicate call to INCLUDE_DIRECTORIES(dependencies/msvc) from
later on in the main CMakeLists.txt.
@rkitover

This comment has been minimized.

Copy link
Collaborator

rkitover commented Feb 11, 2017

@edorax one more thing, I cleaned up the dependencies/msvc checking code a little bit, can you please check that everything still works?

@edorax

This comment has been minimized.

Copy link
Contributor Author

edorax commented Feb 11, 2017

@rkitover Your changes are OK, verified for MXE and VS2012.

@edorax

This comment has been minimized.

Copy link
Contributor Author

edorax commented Feb 11, 2017

@rkitover
I haven't download mingw tarballs for this build.

It's a long story about how to build vba-m with cmake & VS.

The most libraries needed was built before I met vba-m.
These are zlib, libpng, SDL2 and wxWidgets 3.0.2.
And most of them was installed in C:\opt for convenience by manually copying header and lib files.
cmake will check for yasm, I downloaded yasm.exe and put it in the search path(C:\opt\bin),
but VS does not assemble the *.asm files, to work around this, I disabled the ASM optimization(see the cmake options at last).
Manually built wxrc.exe from the source(nmake -f makefile.vc) in Developer Command Prompt for VS and put it in C:\opt\bin .
I found a copy of zip.exe(need by wxrc.exe?) in the installation of the CodeBlocks and put it C:\opt\bin .

Since many other things(e.g. gettext) are not installed on my box, I disabled some corresponding options in cmake command line to work around.

The command line I used to generate the VS solution/projects with cmake:
(Note: you don't have to run it in the Developer Command Prompt for VS.)
cmake -G "Visual Studio 11" -DwxWidgets_ROOT_DIR="D:\wdir-svn\MiscTools\wxWidgets\wxWidgets-3.0.2" -DCMAKE_LIBRARY_PATH:STRING="C:\opt\common_libs\lib" -DZLIB_ROOT:STRING="C:\opt\common_libs" -DPNG_PNG_INCLUDE_DIR:STRING="C:\opt\common_libs\include" -DSDL2_PATH:STRING="C:\opt\SDL2" -DSDL2_STATIC:BOOL=ON -DENABLE_LINK:BOOL=OFF -DENABLE_OPENAL:BOOL=OFF -DENABLE_NLS:BOOL=OFF -DENABLE_ASM_CORE:BOOL=OFF -DENABLE_ASM_SCALERS:BOOL=OFF ../vba-m/visualboyadvance-m

@rkitover

This comment has been minimized.

Copy link
Collaborator

rkitover commented Feb 11, 2017

@edorax

Awesome, thank you for the info, if and when I have time, I will try to replicate the process and see if we can automate it a bit more as well.

As for YASM, there is no explicit YASM support in the cmake files yet, I will need to add that.

I told @doctorwho11 that everything is good to merge.

You can find us on #vba-m on freenode if you use irc.

@rkitover rkitover merged commit 98718f2 into visualboyadvance-m:master Feb 11, 2017
rkitover added a commit that referenced this pull request Feb 11, 2017
Add a hack to the root CMakeLists.txt to SET(MSYS ON) for the Ninja
generator when running under msys2, otherwise it cannot find libs.

The quoting fixes from #70 allow all of this to work.
rkitover pushed a commit that referenced this pull request Aug 15, 2019
Update Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.