CMake / integrated Lua

Source Code and development in general from a technical point of view. Post Patches here.

Moderator: SMC Team

CMake / integrated Lua

Postby Quintus » 03 Jan 2013 15:21

I’ve ported SMC to CMake, which IMO makes the whole configuration process IMO much easier. The changes are in my fork in the integrate-lua branch, and you can now compile SMC on Linux like this:

Code: Select all
$ cd SMC/smc
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/home/you/smc .. # Or wherever you want it to be
$ make
$ make install
$ /home/you/smc/bin/smc # Or wherever you installed it


I’m not entirely sure about the process on Windows with MSVC, but it should work by specifying a proper -G option to cmake (see http://stackoverflow.com/questions/2437481/cmake-and-visual-studio) and then opening the resulting MSVC project file in Visual Studio. You should then be able to issue the "compile" command from Visual Studio and it should do. Luiji, perhaps you have a more clear idea here?

As CMake is able to generate build files for various compiler/IDE combinations out there, it should now be easier to support other compilers (yes, I’m still hoping to port it to MinGW finally...) as we don’t have to maintain the build files by hand anymore. And we can remove the insane number of autohell files spread all over the build tree if we switch to CMake as the sole build system. But please note that the main CMakeLists.txt is currently very bare regarding target dependencies (it just does a big recursive glob of the sourcefiles), it would be better to break this down into subprojects with fewer sourcefiles that are then linked together.

Last but not least I’ve included Lua directly as a CMake subproject. This means there will NOT be any Lua compilation issues anymore. The Lua 5.2 library is build together with SMC as a static library, then linked directly into the smc executable without ever searching any system library paths so no Lua system libraries will interfere anymore. Also, I’ve resynchronised my fork with the latest changes in FluXy’s upstream repository.

Happy hacking! :)

Vale,
Quintus
Aetas nulla ad discendum sera.
User avatar
Quintus
SMC Team
SMC Team
 
Posts: 353
Joined: 14 Sep 2010 18:05
Location: Germany -> NRW -> UN

Re: CMake / integrated Lua

Postby Luiji » 03 Jan 2013 23:36

;( The entire world is falling to CMake... why is it so popular? The syntax of CMakeFiles is hideous! (IMO. Just curious.)

Should still be better than Autoconf during Windows builds.
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom

Re: CMake / integrated Lua

Postby Quintus » 04 Jan 2013 00:08

Luiji wrote:;( The entire world is falling to CMake... why is it so popular? The syntax of CMakeFiles is hideous! (IMO. Just curious.)
The CMake syntax indeed is not the nicest one, it feels a bit... raw. (in German I’d say "klobig", in English I don’t have an equivalent...). However, compared to the insanely bracketed M4 autotool syntax, this already is an improvement. Then, CMake provides really cross-platform makefiles by generating files for many compiler/IDE/nonIDE combinations out there. It has a great number of prepackaged finding modules for popular software so no need to write your own software finding code. It is backed by a Company (Kitware Inc.) so it won’t go away soon. It automatically generates installers for you (CPack). It took me less than two days to learn the basics. It provides nearly all of the features autotools has. Everything goes into a single, central file per project. No eternal re-generation cycles (wait! Do I have to run autoheader or automake first? aclocal? Or was it autoreconf? Shit!). Compared to other build system alternatives, it has a fairly wide-spread use (KDE!) and googling for problems usually turns up a useful results thanks to this. For those who need it, it even provides a GUI for adjusting the compilation options (and a CUI for terminal users, ccmake). And last but not least it has colors ;)

For the recent time I’ve not seen any development in SMC, and I think I cannot use autotools productively, hence I decided to do something about it and switch to CMake, which I’m most familiar with.

Vale,
Quintus
Aetas nulla ad discendum sera.
User avatar
Quintus
SMC Team
SMC Team
 
Posts: 353
Joined: 14 Sep 2010 18:05
Location: Germany -> NRW -> UN

Re: CMake / integrated Lua

Postby penguin » 04 Jan 2013 04:24

:D Quintus, you just worked a miracle! I never thought I would get lua built on my own, but I got cmake to work! :D I tried compiling, it looks like lua worked, but the SMC portion failed. Here's the build log.
Code: Select all
------ Build started: Project: lua, Configuration: Debug Win32 ------
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.
cl /Od /I "C:\dev\smc\libpng\include" /I "C:\dev\smc\zlib\include" /I "C:\dev\smc\SDL\include" /I "C:\dev\smc\SDL_image\include" /I "C:\dev\smc\SDL_mixer\include" /I "C:\dev\smc\SDL_ttf\include" /I "C:\dev\smc\CEGUI\include" /I "\CEGUI" /I "C:\Documents and Settings\David\Desktop\boost_1_50_0\boost_1_50_0" /I "\lua-5.2.1\src" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /RTC1 /MDd /Fo"lua.dir\Debug\\" /Fd"C:\Program Files\smc\git\2013\JAN\03\26595D397F\lua\Debug/lua.pdb" /W3 /c /Zi /TC   /Zm1000
   ".\lua-5.2.1\src\lapi.c"
   ".\lua-5.2.1\src\lzio.c"
   ".\lua-5.2.1\src\lvm.c"
   ".\lua-5.2.1\src\lundump.c"
   ".\lua-5.2.1\src\luac.c"
   ".\lua-5.2.1\src\lua.c"
   ".\lua-5.2.1\src\ltm.c"
   ".\lua-5.2.1\src\ltablib.c"
   ".\lua-5.2.1\src\ltable.c"
   ".\lua-5.2.1\src\lstrlib.c"
   ".\lua-5.2.1\src\lstring.c"
   ".\lua-5.2.1\src\lstate.c"
   ".\lua-5.2.1\src\lparser.c"
   ".\lua-5.2.1\src\loslib.c"
   ".\lua-5.2.1\src\lopcodes.c"
   ".\lua-5.2.1\src\lobject.c"
   ".\lua-5.2.1\src\loadlib.c"
   ".\lua-5.2.1\src\lmem.c"
   ".\lua-5.2.1\src\lmathlib.c"
   ".\lua-5.2.1\src\llex.c"
   ".\lua-5.2.1\src\liolib.c"
   ".\lua-5.2.1\src\linit.c"
   ".\lua-5.2.1\src\lgc.c"
   ".\lua-5.2.1\src\lfunc.c"
   ".\lua-5.2.1\src\ldump.c"
   ".\lua-5.2.1\src\ldo.c"
   ".\lua-5.2.1\src\ldebug.c"
   ".\lua-5.2.1\src\ldblib.c"
   ".\lua-5.2.1\src\lctype.c"
   ".\lua-5.2.1\src\lcorolib.c"
   ".\lua-5.2.1\src\lcode.c"
   ".\lua-5.2.1\src\lbitlib.c"
   ".\lua-5.2.1\src\lbaselib.c"
   ".\lua-5.2.1\src\lauxlib.c"
lapi.c
lzio.c
lvm.c
.\lua-5.2.1\src\lvm.c(53) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
lundump.c
luac.c
.\lua-5.2.1\src\luac.c(43) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\luac.c(178) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
lua.c
.\lua-5.2.1\src\lua.c(424) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
.\lua-5.2.1\src\lua.c(427) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
ltm.c
ltablib.c
ltable.c
lstrlib.c
.\lua-5.2.1\src\lstrlib.c(798) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(800) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(839) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(74) : see declaration of 'strcpy'
.\lua-5.2.1\src\lstrlib.c(867) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(877) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(887) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(896) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(913) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
lstring.c
lstate.c
lparser.c
loslib.c
.\lua-5.2.1\src\loslib.c(108) : warning C4996: 'tmpnam': This function or variable may be unsafe. Consider using tmpnam_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(340) : see declaration of 'tmpnam'
.\lua-5.2.1\src\loslib.c(117) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
.\lua-5.2.1\src\loslib.c(200) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(101) : see declaration of 'gmtime'
.\lua-5.2.1\src\loslib.c(204) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
lopcodes.c
lobject.c
.\lua-5.2.1\src\lobject.c(212) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
loadlib.c
.\lua-5.2.1\src\loadlib.c(331) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\loadlib.c(639) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
.\lua-5.2.1\src\loadlib.c(641) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
lmem.c
lmathlib.c
llex.c
Generating Code...
Compiling...
liolib.c
.\lua-5.2.1\src\liolib.c(205) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\liolib.c(207) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\liolib.c(223) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\liolib.c(249) : warning C4996: 'tmpfile': This function or variable may be unsafe. Consider using tmpfile_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(334) : see declaration of 'tmpfile'
.\lua-5.2.1\src\liolib.c(343) : warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(256) : see declaration of 'fscanf'
linit.c
lgc.c
.\lua-5.2.1\src\lgc.c(988) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
lfunc.c
ldump.c
ldo.c
ldebug.c
ldblib.c
lctype.c
lcorolib.c
lcode.c
lbitlib.c
lbaselib.c
lauxlib.c
.\lua-5.2.1\src\lauxlib.c(215) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\lauxlib.c(217) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\lauxlib.c(587) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\lauxlib.c(641) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\lauxlib.c(647) : warning C4996: 'freopen': This function or variable may be unsafe. Consider using freopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(252) : see declaration of 'freopen'
Generating Code...
Creating library...
lua.obj : warning LNK4006: _main already defined in luac.obj; second definition ignored
Build log was saved at "file://c:\Program Files\smc\git\2013\JAN\03\26595D397F\lua\lua.dir\Debug\BuildLog.htm"
lua - 0 error(s), 33 warning(s)
------ Build started: Project: smc, Configuration: Debug Win32 ------
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.
cl /Od /I "C:\dev\smc\libpng\include" /I "C:\dev\smc\zlib\include" /I "C:\dev\smc\SDL\include" /I "C:\dev\smc\SDL_image\include" /I "C:\dev\smc\SDL_mixer\include" /I "C:\dev\smc\SDL_ttf\include" /I "C:\dev\smc\CEGUI\include" /I "\CEGUI" /I "C:\Documents and Settings\David\Desktop\boost_1_50_0\boost_1_50_0" /I "C:\Program Files\smc\git\2013\JAN\03\26595D397F\lua\lua-5.2.1\src" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "DATA_DIR=\"C:/Program Files/smc/git/2013/JAN/03/26595D397F/share/smc\"" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Fo"smc.dir\Debug\\" /Fd"C:\Program Files\smc\git\2013\JAN\03\26595D397F\Debug/smc.pdb" /W3 /c /Zi /TP   /Zm1000
   ".\src\video\video.cpp"
   ".\src\video\renderer.cpp"
   ".\src\video\img_settings.cpp"
   ".\src\video\img_manager.cpp"
   ".\src\video\gl_surface.cpp"
   ".\src\video\font.cpp"
   ".\src\video\animation.cpp"
   ".\src\user\savegame.cpp"
   ".\src\user\preferences.cpp"
   ".\src\script\scriptable_object.cpp"
   ".\src\script\script.cpp"
   ".\src\script\objects\l_timers.cpp"
   ".\src\script\objects\l_sprite.cpp"
   ".\src\script\objects\l_particle_emitter.cpp"
   ".\src\script\objects\l_object.cpp"
   ".\src\script\objects\l_moving_sprite.cpp"
   ".\src\script\objects\l_message.cpp"
   ".\src\script\objects\l_level_player.cpp"
   ".\src\script\objects\l_level.cpp"
   ".\src\script\objects\l_input.cpp"
   ".\src\script\objects\l_gee.cpp"
   ".\src\script\objects\l_furball.cpp"
   ".\src\script\objects\l_flyon.cpp"
   ".\src\script\objects\l_enemy.cpp"
   ".\src\script\objects\l_eato.cpp"
   ".\src\script\objects\l_audio.cpp"
   ".\src\script\objects\l_animated_sprite.cpp"
   ".\src\script\luawrap.cpp"
   ".\src\script\events\touch_event.cpp"
   ".\src\script\events\shoot_event.cpp"
   ".\src\script\events\level_save_event.cpp"
   ".\src\script\events\level_load_event.cpp"
   ".\src\script\events\key_down_event.cpp"
   ".\src\script\events\event.cpp"
   ".\src\script\events\downgrade_event.cpp"
   ".\src\overworld\world_waypoint.cpp"
   ".\src\overworld\world_sprite_manager.cpp"
   ".\src\overworld\world_player.cpp"
   ".\src\overworld\world_manager.cpp"
   ".\src\overworld\world_layer.cpp"
   ".\src\overworld\world_editor.cpp"
   ".\src\overworld\overworld.cpp"
   ".\src\objects\text_box.cpp"
   ".\src\objects\star.cpp"
   ".\src\objects\sprite.cpp"
   ".\src\objects\spinbox.cpp"
   ".\src\objects\powerup.cpp"
   ".\src\objects\path.cpp"
   ".\src\objects\moving_platform.cpp"
   ".\src\objects\movingsprite.cpp"
   ".\src\objects\level_exit.cpp"
   ".\src\objects\level_entry.cpp"
   ".\src\objects\goldpiece.cpp"
   ".\src\objects\enemystopper.cpp"
   ".\src\objects\box.cpp"
   ".\src\objects\bonusbox.cpp"
   ".\src\objects\ball.cpp"
   ".\src\objects\animated_sprite.cpp"
   ".\src\level\level_settings.cpp"
   ".\src\level\level_player.cpp"
   ".\src\level\level_manager.cpp"
   ".\src\level\level_editor.cpp"
   ".\src\level\level_background.cpp"
   ".\src\level\level.cpp"
   ".\src\input\mouse.cpp"
   ".\src\input\keyboard.cpp"
   ".\src\input\joystick.cpp"
   ".\src\gui\spinner.cpp"
   ".\src\gui\menu_data.cpp"
   ".\src\gui\menu.cpp"
   ".\src\gui\hud.cpp"
   ".\src\gui\generic.cpp"
   ".\src\enemies\turtle.cpp"
   ".\src\enemies\thromp.cpp"
   ".\src\enemies\static.cpp"
   ".\src\enemies\spikeball.cpp"
   ".\src\enemies\spika.cpp"
   ".\src\enemies\rokko.cpp"
   ".\src\enemies\krush.cpp"
   ".\src\enemies\gee.cpp"
   ".\src\enemies\furball.cpp"
   ".\src\enemies\flyon.cpp"
   ".\src\enemies\enemy.cpp"
   ".\src\enemies\eato.cpp"
   ".\src\enemies\bosses\turtle_boss.cpp"
   ".\src\core\sprite_manager.cpp"
   ".\src\core\property_helper.cpp"
   ".\src\core\math\vector.cpp"
   ".\src\core\math\utilities.cpp"
   ".\src\core\main.cpp"
   ".\src\core\i18n.cpp"
   ".\src\core\game_core.cpp"
   ".\src\core\framerate.cpp"
   ".\src\core\file_parser.cpp"
   ".\src\core\filesystem\resource_manager.cpp"
   ".\src\core\filesystem\filesystem.cpp"
   ".\src\core\editor.cpp"
   ".\src\core\collision.cpp"
   ".\src\core\campaign_manager.cpp"
   ".\src\core\camera.cpp"
   ".\src\audio\sound_manager.cpp"
   ".\src\audio\random_sound.cpp"
   ".\src\audio\audio.cpp"
video.cpp
.\src\video\video.cpp(126) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(126) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(164) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(164) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(1823) : warning C4996: '_wfopen': This function or variable may be unsafe. Consider using _wfopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(594) : see declaration of '_wfopen'
renderer.cpp
img_settings.cpp
.\src\video\img_settings.cpp(86) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
.\src\video\img_settings.cpp(86) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
img_manager.cpp
gl_surface.cpp
font.cpp
animation.cpp
savegame.cpp
preferences.cpp
scriptable_object.cpp
script.cpp
l_timers.cpp
.\src\script\objects\l_timers.cpp(174) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
l_sprite.cpp
l_particle_emitter.cpp
l_object.cpp
l_moving_sprite.cpp
l_message.cpp
l_level_player.cpp
l_level.cpp
.\src\script\objects\l_level.cpp(61) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
.\src\script\objects\l_level.cpp(90) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
l_input.cpp
Generating Code...
Compiling...
l_gee.cpp
l_furball.cpp
l_flyon.cpp
l_enemy.cpp
l_eato.cpp
l_audio.cpp
.\src\script\objects\l_audio.cpp(42) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
l_animated_sprite.cpp
luawrap.cpp
touch_event.cpp
shoot_event.cpp
level_save_event.cpp
level_load_event.cpp
key_down_event.cpp
event.cpp
downgrade_event.cpp
world_waypoint.cpp
world_sprite_manager.cpp
world_player.cpp
world_manager.cpp
world_layer.cpp
Generating Code...
Compiling...
world_editor.cpp
overworld.cpp
text_box.cpp
star.cpp
sprite.cpp
spinbox.cpp
powerup.cpp
.\src\objects\powerup.cpp(746) : warning C4244: '+=' : conversion from 'double' to 'float', possible loss of data
path.cpp
moving_platform.cpp
movingsprite.cpp
level_exit.cpp
level_entry.cpp
goldpiece.cpp
enemystopper.cpp
box.cpp
bonusbox.cpp
ball.cpp
animated_sprite.cpp
level_settings.cpp
.\src\level\level_settings.cpp(264) : warning C4244: 'argument' : conversion from 'double' to 'const Uint8', possible loss of data
.\src\level\level_settings.cpp(271) : warning C4244: 'argument' : conversion from 'double' to 'const float', possible loss of data
.\src\level\level_settings.cpp(272) : warning C4244: 'argument' : conversion from 'double' to 'const float', possible loss of data
.\src\level\level_settings.cpp(276) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(532) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(533) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(534) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(535) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(591) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(594) : warning C4244: 'argument' : conversion from 'float' to 'Uint8', possible loss of data
.\src\level\level_settings.cpp(605) : warning C4244: 'argument' : conversion from 'float' to 'Uint8', possible loss of data
level_player.cpp
Generating Code...
Compiling...
level_manager.cpp
level_editor.cpp
level_background.cpp
level.cpp
mouse.cpp
.\src\input\mouse.cpp(1023) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1024) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1025) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1026) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1027) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1028) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
keyboard.cpp
joystick.cpp
spinner.cpp
menu_data.cpp
.\src\gui\menu_data.cpp(2346) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2347) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2357) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2358) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2503) : warning C4244: '=' : conversion from 'double' to 'Uint16', possible loss of data
menu.cpp
hud.cpp
generic.cpp
turtle.cpp
thromp.cpp
static.cpp
spikeball.cpp
spika.cpp
rokko.cpp
krush.cpp
gee.cpp
Generating Code...
Compiling...
furball.cpp
flyon.cpp
enemy.cpp
eato.cpp
turtle_boss.cpp
sprite_manager.cpp
property_helper.cpp
.\src\core\property_helper.cpp(419) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
vector.cpp
utilities.cpp
main.cpp
i18n.cpp
game_core.cpp
framerate.cpp
file_parser.cpp
resource_manager.cpp
filesystem.cpp
.\src\core\filesystem\filesystem.cpp(77) : error C2664: 'DeleteFileA' : cannot convert parameter 1 from 'const wchar_t *' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(87) : error C2664: 'RemoveDirectoryA' : cannot convert parameter 1 from 'const wchar_t *' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(107) : error C2664: 'MoveFileExA' : cannot convert parameter 1 from 'const wchar_t *' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(122) : error C2664: 'CreateDirectoryA' : cannot convert parameter 1 from 'const wchar_t *' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(240) : error C2664: 'SMC::ucs2_to_utf8' : cannot convert parameter 1 from 'TCHAR [260]' to 'const std::wstring &'
        Reason: cannot convert from 'TCHAR [260]' to 'const std::wstring'
        No constructor could take the source type, or constructor overload resolution was ambiguous
.\src\core\filesystem\filesystem.cpp(260) : error C2664: 'SMC::ucs2_to_utf8' : cannot convert parameter 1 from 'TCHAR [261]' to 'const std::wstring &'
        Reason: cannot convert from 'TCHAR [261]' to 'const std::wstring'
        No constructor could take the source type, or constructor overload resolution was ambiguous
editor.cpp
.\src\core\editor.cpp(149) : warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data
.\src\core\editor.cpp(149) : warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data
collision.cpp
campaign_manager.cpp
camera.cpp
.\src\core\camera.cpp(39) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
Generating Code...
Compiling...
sound_manager.cpp
random_sound.cpp
audio.cpp
Generating Code...
Build log was saved at "file://c:\Program Files\smc\git\2013\JAN\03\26595D397F\smc.dir\Debug\BuildLog.htm"
smc - 6 error(s), 38 warning(s)
------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
Project not selected to build for this solution configuration
========== Build: 1 succeeded, 1 failed, 2 up-to-date, 1 skipped ==========


What do you think?
my wiki page
I may disappear for a long time, but trust me, I'm still alive.
User avatar
penguin
Turtle boss
Turtle boss
 
Posts: 665
Joined: 14 Nov 2009 14:37
Location: Nebraska

Re: CMake / integrated Lua

Postby Luiji » 04 Jan 2013 04:46

Beautiful. Now if only CEGUI was so easy... :P

Personally I prefer SCons. I like having a full-on programming language at my hands. I'd use Rake, but it requires a bit more work. In the end, I'd prefer writing my own SCons-like tool in Ruby that is as featureful as CMake, then I'd be happy.

Also, the English-German dictionary I'm using translates Klobig as "chunky".

Penguin: you need to define _CRT_SECURE_NO_WARNINGS, otherwise MSVC will force Scheibe code.
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom

Re: CMake / integrated Lua

Postby Quintus » 04 Jan 2013 12:45

penguin wrote:What do you think?
Yes, Lua built fine. The culprit is here:
Code: Select all
filesystem.cpp
.\src\core\filesystem\filesystem.cpp(77) : error C2664: 'DeleteFileA' : cannot convert parameter 1 from 'const wchar_t *' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(87) : error C2664: 'RemoveDirectoryA' : cannot convert parameter 1 from 'const wchar_t *' to 'LPCSTR'
I’ll look into that, it has something to do with C++’s unicode string stuff. Seems as if I have to read up on wchar_t again...

Luiji wrote:Personally I prefer SCons. I like having a full-on programming language at my hands.
While I agree with this point...
Luji wrote:In the end, I'd prefer writing my own SCons-like tool in Ruby that is as featureful as CMake, then I'd be happy.
I don’t do so with this one. Indeed, a Ruby build system would be great and I’d be a happy user of it, but you’d be starting from zero, while CMake already has seen much development. SMC needs development now, not after yet another library/tool/whatever. And as said, CMake alraedy has a big community, which helpfully answers questions about it, which has to build up around a Ruby build system yet. I don’t say this is impossible, but it will take some time to complete, probably a year or two until it can compare with the big build system alternatives out there. I’d even work together with you on that project, but what should be avoided is the effet I’ve seen with bjam: Nobody uses it, nobody can answer questions about it, but the only project you need it for is boost. This is kind of an insular solution, which only frustrates users that are actually trying to build boost and have problems with their build system. Or for short: I’d like some uniformity on software building systems. Having each project using a different build system causes real headache when you have to compile a whole dependency tree or something like that.

Luiji wrote:I'd use Rake, but it requires a bit more work.
Ruby comes together with a library named mkmf which gives you the possibilities to check for software. It however is intended for Ruby C extensions and will only generate Makefiles for that. Using Rake is probably a good idea, but again you’d have to build up the ecosystem provided by autotools, CMake, etc. starting at simple questions like "what’s the way to activate debugging mode in all compilers out there in the word"?

Luiji wrote:Personally I prefer SCons.
Fine. So port SMC to SCons.

Luiji wrote:Also, the English-German dictionary I'm using translates Klobig as "chunky".
Hm, ok. I’ll remember that one.

Luiji wrote:otherwise MSVC will force Scheibe code.
:D But really, sprintf() is unsafe on Windows? What?

Vale,
Quintus
Aetas nulla ad discendum sera.
User avatar
Quintus
SMC Team
SMC Team
 
Posts: 353
Joined: 14 Sep 2010 18:05
Location: Germany -> NRW -> UN

Re: CMake / integrated Lua

Postby Luiji » 04 Jan 2013 19:03

I always like reinventing wheels, which makes me pretty impractical. I'm trying to hold onto pre-existing build systems for now. Though I prefer SCons, I'm totally fine with using CMake since you already did the part I hate (writing the CMakeLists.txt). :P

Microsoft states that you should use sprintf_s instead of sprintf or even snprintf to avoid buffer overflow. In reality, it's redundant of the snprintf function and appears to be just part of a scheme to lock developers to the MSVC platform. Compiling with _CRT_SECURE_NO_WARNINGS defined will tell MSVC that you see through its trickery and it will stop showing those errors. :ninja:
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom

Re: CMake / integrated Lua

Postby Quintus » 06 Jan 2013 12:37

Luiji wrote:In reality, it's redundant of the snprintf function and appears to be just part of a scheme to lock developers to the MSVC platform. Compiling with _CRT_SECURE_NO_WARNINGS defined will tell MSVC that you see through its trickery and it will stop showing those errors. :ninja:


Ah ok. May I also define this directly in some central header like this?

Code: Select all
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1
#endif

Or has this to be manually adjusted by the user?

@Penguin: I’ve changed the faulty code to use Windows’ Unicode functions instead of the ASCII ones. Could you please check with the latest git?

Valete,
Quintus
Aetas nulla ad discendum sera.
User avatar
Quintus
SMC Team
SMC Team
 
Posts: 353
Joined: 14 Sep 2010 18:05
Location: Germany -> NRW -> UN

Re: CMake / integrated Lua

Postby penguin » 07 Jan 2013 00:54

Quintus wrote:Ah ok. May I also define this directly in some central header like this?

Code: Select all
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1
#endif

Or has this to be manually adjusted by the user?

It looks like it must manually be added to the code as I tried compling with /_CRT_SECURE_NO_WARNINGS as a command line option and it did not recognize it. It looks like the old errors were fixed but new ones arised.

Code: Select all
------ Build started: Project: lua, Configuration: Debug Win32 ------
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.
cl /Od /I "C:\dev\smc\libpng\include" /I "C:\dev\smc\zlib\include" /I "C:\dev\smc\SDL\include" /I "C:\dev\smc\SDL_image\include" /I "C:\dev\smc\SDL_mixer\include" /I "C:\dev\smc\SDL_ttf\include" /I "C:\dev\smc\CEGUI\include" /I "\CEGUI" /I "C:\Documents and Settings\David\Desktop\boost_1_50_0\boost_1_50_0" /I "\lua-5.2.1\src" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /RTC1 /MDd /Fo"lua.dir\Debug\\" /Fd"C:\Program Files\smc\git\2013\JAN\06\6E36426786\lua\Debug/lua.pdb" /W3 /c /Zi /TC   /Zm1000
   ".\lua-5.2.1\src\lapi.c"
   ".\lua-5.2.1\src\lzio.c"
   ".\lua-5.2.1\src\lvm.c"
   ".\lua-5.2.1\src\lundump.c"
   ".\lua-5.2.1\src\luac.c"
   ".\lua-5.2.1\src\lua.c"
   ".\lua-5.2.1\src\ltm.c"
   ".\lua-5.2.1\src\ltablib.c"
   ".\lua-5.2.1\src\ltable.c"
   ".\lua-5.2.1\src\lstrlib.c"
   ".\lua-5.2.1\src\lstring.c"
   ".\lua-5.2.1\src\lstate.c"
   ".\lua-5.2.1\src\lparser.c"
   ".\lua-5.2.1\src\loslib.c"
   ".\lua-5.2.1\src\lopcodes.c"
   ".\lua-5.2.1\src\lobject.c"
   ".\lua-5.2.1\src\loadlib.c"
   ".\lua-5.2.1\src\lmem.c"
   ".\lua-5.2.1\src\lmathlib.c"
   ".\lua-5.2.1\src\llex.c"
   ".\lua-5.2.1\src\liolib.c"
   ".\lua-5.2.1\src\linit.c"
   ".\lua-5.2.1\src\lgc.c"
   ".\lua-5.2.1\src\lfunc.c"
   ".\lua-5.2.1\src\ldump.c"
   ".\lua-5.2.1\src\ldo.c"
   ".\lua-5.2.1\src\ldebug.c"
   ".\lua-5.2.1\src\ldblib.c"
   ".\lua-5.2.1\src\lctype.c"
   ".\lua-5.2.1\src\lcorolib.c"
   ".\lua-5.2.1\src\lcode.c"
   ".\lua-5.2.1\src\lbitlib.c"
   ".\lua-5.2.1\src\lbaselib.c"
   ".\lua-5.2.1\src\lauxlib.c"
lapi.c
lzio.c
lvm.c
.\lua-5.2.1\src\lvm.c(53) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
lundump.c
luac.c
.\lua-5.2.1\src\luac.c(43) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\luac.c(178) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
lua.c
.\lua-5.2.1\src\lua.c(424) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
.\lua-5.2.1\src\lua.c(427) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
ltm.c
ltablib.c
ltable.c
lstrlib.c
.\lua-5.2.1\src\lstrlib.c(798) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(800) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(839) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(74) : see declaration of 'strcpy'
.\lua-5.2.1\src\lstrlib.c(867) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(877) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(887) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(896) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
.\lua-5.2.1\src\lstrlib.c(913) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
lstring.c
lstate.c
lparser.c
loslib.c
.\lua-5.2.1\src\loslib.c(108) : warning C4996: 'tmpnam': This function or variable may be unsafe. Consider using tmpnam_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(340) : see declaration of 'tmpnam'
.\lua-5.2.1\src\loslib.c(117) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
.\lua-5.2.1\src\loslib.c(200) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(101) : see declaration of 'gmtime'
.\lua-5.2.1\src\loslib.c(204) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
lopcodes.c
lobject.c
.\lua-5.2.1\src\lobject.c(212) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
loadlib.c
.\lua-5.2.1\src\loadlib.c(331) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\loadlib.c(639) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
.\lua-5.2.1\src\loadlib.c(641) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : see declaration of 'getenv'
lmem.c
lmathlib.c
llex.c
Generating Code...
Compiling...
liolib.c
.\lua-5.2.1\src\liolib.c(205) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\liolib.c(207) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\liolib.c(223) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\liolib.c(249) : warning C4996: 'tmpfile': This function or variable may be unsafe. Consider using tmpfile_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(334) : see declaration of 'tmpfile'
.\lua-5.2.1\src\liolib.c(343) : warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(256) : see declaration of 'fscanf'
linit.c
lgc.c
.\lua-5.2.1\src\lgc.c(988) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
lfunc.c
ldump.c
ldo.c
ldebug.c
ldblib.c
lctype.c
lcorolib.c
lcode.c
lbitlib.c
lbaselib.c
lauxlib.c
.\lua-5.2.1\src\lauxlib.c(215) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\lauxlib.c(217) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\lauxlib.c(587) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : see declaration of 'strerror'
.\lua-5.2.1\src\lauxlib.c(641) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen'
.\lua-5.2.1\src\lauxlib.c(647) : warning C4996: 'freopen': This function or variable may be unsafe. Consider using freopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(252) : see declaration of 'freopen'
Generating Code...
Creating library...
lua.obj : warning LNK4006: _main already defined in luac.obj; second definition ignored
Build log was saved at "file://c:\Program Files\smc\git\2013\JAN\06\6E36426786\lua\lua.dir\Debug\BuildLog.htm"
lua - 0 error(s), 33 warning(s)
------ Build started: Project: smc, Configuration: Debug Win32 ------
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.
cl /Od /I "C:\dev\smc\libpng\include" /I "C:\dev\smc\zlib\include" /I "C:\dev\smc\SDL\include" /I "C:\dev\smc\SDL_image\include" /I "C:\dev\smc\SDL_mixer\include" /I "C:\dev\smc\SDL_ttf\include" /I "C:\dev\smc\CEGUI\include" /I "\CEGUI" /I "C:\Documents and Settings\David\Desktop\boost_1_50_0\boost_1_50_0" /I "C:\Program Files\smc\git\2013\JAN\06\6E36426786\lua\lua-5.2.1\src" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "DATA_DIR=\"C:/Program Files/smc/git/2013/JAN/06/6E36426786/share/smc\"" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Fo"smc.dir\Debug\\" /Fd"C:\Program Files\smc\git\2013\JAN\06\6E36426786\Debug/smc.pdb" /W3 /c /Zi /TP   /Zm1000
   ".\src\video\video.cpp"
   ".\src\video\renderer.cpp"
   ".\src\video\img_settings.cpp"
   ".\src\video\img_manager.cpp"
   ".\src\video\gl_surface.cpp"
   ".\src\video\font.cpp"
   ".\src\video\animation.cpp"
   ".\src\user\savegame.cpp"
   ".\src\user\preferences.cpp"
   ".\src\script\scriptable_object.cpp"
   ".\src\script\script.cpp"
   ".\src\script\objects\l_timers.cpp"
   ".\src\script\objects\l_sprite.cpp"
   ".\src\script\objects\l_particle_emitter.cpp"
   ".\src\script\objects\l_object.cpp"
   ".\src\script\objects\l_moving_sprite.cpp"
   ".\src\script\objects\l_message.cpp"
   ".\src\script\objects\l_level_player.cpp"
   ".\src\script\objects\l_level.cpp"
   ".\src\script\objects\l_input.cpp"
   ".\src\script\objects\l_gee.cpp"
   ".\src\script\objects\l_furball.cpp"
   ".\src\script\objects\l_flyon.cpp"
   ".\src\script\objects\l_enemy.cpp"
   ".\src\script\objects\l_eato.cpp"
   ".\src\script\objects\l_audio.cpp"
   ".\src\script\objects\l_animated_sprite.cpp"
   ".\src\script\luawrap.cpp"
   ".\src\script\events\touch_event.cpp"
   ".\src\script\events\shoot_event.cpp"
   ".\src\script\events\level_save_event.cpp"
   ".\src\script\events\level_load_event.cpp"
   ".\src\script\events\key_down_event.cpp"
   ".\src\script\events\event.cpp"
   ".\src\script\events\downgrade_event.cpp"
   ".\src\overworld\world_waypoint.cpp"
   ".\src\overworld\world_sprite_manager.cpp"
   ".\src\overworld\world_player.cpp"
   ".\src\overworld\world_manager.cpp"
   ".\src\overworld\world_layer.cpp"
   ".\src\overworld\world_editor.cpp"
   ".\src\overworld\overworld.cpp"
   ".\src\objects\text_box.cpp"
   ".\src\objects\star.cpp"
   ".\src\objects\sprite.cpp"
   ".\src\objects\spinbox.cpp"
   ".\src\objects\powerup.cpp"
   ".\src\objects\path.cpp"
   ".\src\objects\moving_platform.cpp"
   ".\src\objects\movingsprite.cpp"
   ".\src\objects\level_exit.cpp"
   ".\src\objects\level_entry.cpp"
   ".\src\objects\goldpiece.cpp"
   ".\src\objects\enemystopper.cpp"
   ".\src\objects\box.cpp"
   ".\src\objects\bonusbox.cpp"
   ".\src\objects\ball.cpp"
   ".\src\objects\animated_sprite.cpp"
   ".\src\level\level_settings.cpp"
   ".\src\level\level_player.cpp"
   ".\src\level\level_manager.cpp"
   ".\src\level\level_editor.cpp"
   ".\src\level\level_background.cpp"
   ".\src\level\level.cpp"
   ".\src\input\mouse.cpp"
   ".\src\input\keyboard.cpp"
   ".\src\input\joystick.cpp"
   ".\src\gui\spinner.cpp"
   ".\src\gui\menu_data.cpp"
   ".\src\gui\menu.cpp"
   ".\src\gui\hud.cpp"
   ".\src\gui\generic.cpp"
   ".\src\enemies\turtle.cpp"
   ".\src\enemies\thromp.cpp"
   ".\src\enemies\static.cpp"
   ".\src\enemies\spikeball.cpp"
   ".\src\enemies\spika.cpp"
   ".\src\enemies\rokko.cpp"
   ".\src\enemies\krush.cpp"
   ".\src\enemies\gee.cpp"
   ".\src\enemies\furball.cpp"
   ".\src\enemies\flyon.cpp"
   ".\src\enemies\enemy.cpp"
   ".\src\enemies\eato.cpp"
   ".\src\enemies\bosses\turtle_boss.cpp"
   ".\src\core\sprite_manager.cpp"
   ".\src\core\property_helper.cpp"
   ".\src\core\math\vector.cpp"
   ".\src\core\math\utilities.cpp"
   ".\src\core\main.cpp"
   ".\src\core\i18n.cpp"
   ".\src\core\game_core.cpp"
   ".\src\core\framerate.cpp"
   ".\src\core\file_parser.cpp"
   ".\src\core\filesystem\resource_manager.cpp"
   ".\src\core\filesystem\filesystem.cpp"
   ".\src\core\editor.cpp"
   ".\src\core\collision.cpp"
   ".\src\core\campaign_manager.cpp"
   ".\src\core\camera.cpp"
   ".\src\audio\sound_manager.cpp"
   ".\src\audio\random_sound.cpp"
   ".\src\audio\audio.cpp"
video.cpp
.\src\video\video.cpp(126) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(126) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(164) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(164) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
.\src\video\video.cpp(1823) : warning C4996: '_wfopen': This function or variable may be unsafe. Consider using _wfopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(594) : see declaration of '_wfopen'
renderer.cpp
img_settings.cpp
.\src\video\img_settings.cpp(86) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
.\src\video\img_settings.cpp(86) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
img_manager.cpp
gl_surface.cpp
font.cpp
animation.cpp
savegame.cpp
preferences.cpp
scriptable_object.cpp
script.cpp
l_timers.cpp
.\src\script\objects\l_timers.cpp(174) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
l_sprite.cpp
l_particle_emitter.cpp
l_object.cpp
l_moving_sprite.cpp
l_message.cpp
l_level_player.cpp
l_level.cpp
.\src\script\objects\l_level.cpp(61) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
.\src\script\objects\l_level.cpp(90) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
l_input.cpp
Generating Code...
Compiling...
l_gee.cpp
l_furball.cpp
l_flyon.cpp
l_enemy.cpp
l_eato.cpp
l_audio.cpp
.\src\script\objects\l_audio.cpp(42) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
l_animated_sprite.cpp
luawrap.cpp
touch_event.cpp
shoot_event.cpp
level_save_event.cpp
level_load_event.cpp
key_down_event.cpp
event.cpp
downgrade_event.cpp
world_waypoint.cpp
world_sprite_manager.cpp
world_player.cpp
world_manager.cpp
world_layer.cpp
Generating Code...
Compiling...
world_editor.cpp
overworld.cpp
text_box.cpp
star.cpp
sprite.cpp
spinbox.cpp
powerup.cpp
.\src\objects\powerup.cpp(746) : warning C4244: '+=' : conversion from 'double' to 'float', possible loss of data
path.cpp
moving_platform.cpp
movingsprite.cpp
level_exit.cpp
level_entry.cpp
goldpiece.cpp
enemystopper.cpp
box.cpp
bonusbox.cpp
ball.cpp
animated_sprite.cpp
level_settings.cpp
.\src\level\level_settings.cpp(264) : warning C4244: 'argument' : conversion from 'double' to 'const Uint8', possible loss of data
.\src\level\level_settings.cpp(271) : warning C4244: 'argument' : conversion from 'double' to 'const float', possible loss of data
.\src\level\level_settings.cpp(272) : warning C4244: 'argument' : conversion from 'double' to 'const float', possible loss of data
.\src\level\level_settings.cpp(276) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(532) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(533) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(534) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(535) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(591) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
.\src\level\level_settings.cpp(594) : warning C4244: 'argument' : conversion from 'float' to 'Uint8', possible loss of data
.\src\level\level_settings.cpp(605) : warning C4244: 'argument' : conversion from 'float' to 'Uint8', possible loss of data
level_player.cpp
Generating Code...
Compiling...
level_manager.cpp
level_editor.cpp
level_background.cpp
level.cpp
mouse.cpp
.\src\input\mouse.cpp(1023) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1024) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1025) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1026) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1027) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
.\src\input\mouse.cpp(1028) : warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data
keyboard.cpp
joystick.cpp
spinner.cpp
menu_data.cpp
.\src\gui\menu_data.cpp(2346) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2347) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2357) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2358) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
.\src\gui\menu_data.cpp(2503) : warning C4244: '=' : conversion from 'double' to 'Uint16', possible loss of data
menu.cpp
hud.cpp
generic.cpp
turtle.cpp
thromp.cpp
static.cpp
spikeball.cpp
spika.cpp
rokko.cpp
krush.cpp
gee.cpp
Generating Code...
Compiling...
furball.cpp
flyon.cpp
enemy.cpp
eato.cpp
turtle_boss.cpp
sprite_manager.cpp
property_helper.cpp
.\src\core\property_helper.cpp(419) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
vector.cpp
utilities.cpp
main.cpp
i18n.cpp
game_core.cpp
framerate.cpp
file_parser.cpp
resource_manager.cpp
filesystem.cpp
.\src\core\filesystem\filesystem.cpp(232) : error C2664: 'GetTempPathW' : cannot convert parameter 2 from 'TCHAR [260]' to 'LPWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(240) : error C2664: 'SMC::ucs2_to_utf8' : cannot convert parameter 1 from 'TCHAR [260]' to 'const std::wstring &'
        Reason: cannot convert from 'TCHAR [260]' to 'const std::wstring'
        No constructor could take the source type, or constructor overload resolution was ambiguous
.\src\core\filesystem\filesystem.cpp(254) : error C2664: 'SHGetFolderPathW' : cannot convert parameter 5 from 'TCHAR [261]' to 'LPWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\src\core\filesystem\filesystem.cpp(260) : error C2664: 'SMC::ucs2_to_utf8' : cannot convert parameter 1 from 'TCHAR [261]' to 'const std::wstring &'
        Reason: cannot convert from 'TCHAR [261]' to 'const std::wstring'
        No constructor could take the source type, or constructor overload resolution was ambiguous
editor.cpp
.\src\core\editor.cpp(149) : warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data
.\src\core\editor.cpp(149) : warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data
collision.cpp
campaign_manager.cpp
camera.cpp
.\src\core\camera.cpp(39) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
Generating Code...
Compiling...
sound_manager.cpp
random_sound.cpp
audio.cpp
Generating Code...
Build log was saved at "file://c:\Program Files\smc\git\2013\JAN\06\6E36426786\smc.dir\Debug\BuildLog.htm"
smc - 4 error(s), 38 warning(s)
------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
Project not selected to build for this solution configuration
========== Build: 1 succeeded, 1 failed, 2 up-to-date, 1 skipped ==========
my wiki page
I may disappear for a long time, but trust me, I'm still alive.
User avatar
penguin
Turtle boss
Turtle boss
 
Posts: 665
Joined: 14 Nov 2009 14:37
Location: Nebraska

Re: CMake / integrated Lua

Postby Luiji » 07 Jan 2013 07:58

Quintus: I tend to recommend passing it as a compiler flag but with SMC you _should_ be able to put it into core/game_core.h. (...or was it game_basic?)
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom


Return to Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron