Fix build under Visual Studio 2017
Add a few defines and make 'main' functions extern "C" (see SDL_main.h) to fix the build under Visual Studio 2017. Signed-off-by: Paul Cercueil <paul@crapouillou.net>master
parent
2cb2d2979e
commit
4b161eb3a6
|
@ -23,6 +23,14 @@ if (WIN32)
|
|||
set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX})
|
||||
endif (WIN32)
|
||||
|
||||
if (MSVC)
|
||||
# Avoid annoying warnings from Visual Studio
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
# Use M_PI/M_E macros from math.h
|
||||
add_definitions(-D_USE_MATH_DEFINES -DHAVE_M_PI)
|
||||
endif (MSVC)
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu")
|
||||
|
@ -171,6 +179,10 @@ if (NOT USE_SYSTEM_LIBGLEW)
|
|||
add_subdirectory(contrib/glew)
|
||||
add_library(GLEW::GLEW ALIAS glew)
|
||||
include_directories(contrib/glew)
|
||||
|
||||
# Specify that we compile against a static build of Glew
|
||||
# (required on Windows)
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
endif (NOT USE_SYSTEM_LIBGLEW)
|
||||
add_subdirectory(contrib/imgui)
|
||||
add_subdirectory(contrib/jenkins)
|
||||
|
|
|
@ -23,7 +23,7 @@ enum RunMode {
|
|||
MODE_USAGE_ERROR
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
extern "C" int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef PIONEER_PROFILER
|
||||
Profiler::detect(argc, argv);
|
||||
|
|
|
@ -158,7 +158,7 @@ enum RunMode {
|
|||
|
||||
static FileSystem::FileSourceFS customDataDir(".");
|
||||
|
||||
int main(int argc, char **argv)
|
||||
extern "C" int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef PIONEER_PROFILER
|
||||
Profiler::detect(argc, argv);
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
#include "FileSystem.h"
|
||||
#include "GZipFormat.h"
|
||||
#include "Json.h"
|
||||
#include <SDL.h>
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
extern "C" int main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2 || argc > 3) {
|
||||
printf(
|
||||
|
|
Loading…
Reference in New Issue