From 244253d1b8ec622e1aed8af3a45b5836952d9083 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 6 Feb 2021 13:52:49 +1000 Subject: [PATCH] Build: Add precompiled headers for core/frontend-common/qt --- CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 1 + src/core/core.vcxproj | 75 +++++++++++++------ src/core/core.vcxproj.filters | 2 + src/core/pch.cpp | 1 + src/core/pch.h | 8 ++ src/duckstation-qt/CMakeLists.txt | 1 + src/duckstation-qt/duckstation-qt.vcxproj | 75 +++++++++++++------ .../duckstation-qt.vcxproj.filters | 2 + src/duckstation-qt/pch.cpp | 1 + src/duckstation-qt/pch.h | 26 +++++++ src/frontend-common/CMakeLists.txt | 1 + src/frontend-common/frontend-common.vcxproj | 75 +++++++++++++------ .../frontend-common.vcxproj.filters | 2 + src/frontend-common/imgui_impl_opengl3.cpp | 13 +++- src/frontend-common/pch.cpp | 1 + src/frontend-common/pch.h | 2 + 17 files changed, 211 insertions(+), 77 deletions(-) create mode 100644 src/core/pch.cpp create mode 100644 src/core/pch.h create mode 100644 src/duckstation-qt/pch.cpp create mode 100644 src/duckstation-qt/pch.h create mode 100644 src/frontend-common/pch.cpp create mode 100644 src/frontend-common/pch.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 46be669b6..5854d8ddb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(duckstation C CXX) message("CMake Version: ${CMAKE_VERSION}") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a1b5a083a..3edd9dc1b 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -117,6 +117,7 @@ target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_link_libraries(core PUBLIC Threads::Threads common zlib vulkan-loader) target_link_libraries(core PRIVATE glad stb xxhash imgui) target_compile_definitions(core PUBLIC "-DWITH_IMGUI=1") +target_precompile_headers(core PRIVATE pch.h) if(WIN32) target_sources(core PRIVATE diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj index 6142f7c8c..9cdbf3487 100644 --- a/src/core/core.vcxproj +++ b/src/core/core.vcxproj @@ -140,6 +140,20 @@ + + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + @@ -217,6 +231,7 @@ + @@ -463,8 +478,7 @@ - - + Use Level4 Disabled WITH_IMGUI=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -476,6 +490,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -489,8 +505,7 @@ - - + Use Level4 Disabled WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -502,6 +517,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -515,8 +532,7 @@ - - + Use Level4 Disabled WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -528,6 +544,8 @@ stdcpp17 true /Zo /utf-8 /Zc:__cplusplus %(AdditionalOptions) + pch.h + pch.h Windows @@ -541,8 +559,7 @@ - - + Use Level4 Disabled WITH_IMGUI=1;_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -557,6 +574,8 @@ OnlyExplicitInline true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -570,8 +589,7 @@ - - + Use Level4 Disabled WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -586,6 +604,8 @@ OnlyExplicitInline true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -599,8 +619,7 @@ - - + Use Level4 Disabled WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_FASTMEM=1;_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -615,6 +634,8 @@ OnlyExplicitInline true /Zo /utf-8 /Zc:__cplusplus %(AdditionalOptions) + pch.h + pch.h Windows @@ -629,8 +650,7 @@ Level4 - - + Use MaxSpeed true WITH_IMGUI=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -640,6 +660,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -656,8 +678,7 @@ Level4 - - + Use MaxSpeed true WITH_IMGUI=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -668,6 +689,8 @@ true true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -684,8 +707,7 @@ Level4 - - + Use MaxSpeed true WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -695,6 +717,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -711,8 +735,7 @@ Level4 - - + Use MaxSpeed true WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -722,6 +745,8 @@ stdcpp17 true /Zo /utf-8 /Zc:__cplusplus %(AdditionalOptions) + pch.h + pch.h Windows @@ -738,8 +763,7 @@ Level4 - - + Use MaxSpeed true WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -750,6 +774,8 @@ true true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -766,8 +792,7 @@ Level4 - - + Use MaxSpeed true WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -778,6 +803,8 @@ true true /Zo /utf-8 /Zc:__cplusplus %(AdditionalOptions) + pch.h + pch.h Windows diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters index 91d6d1d25..172f23310 100644 --- a/src/core/core.vcxproj.filters +++ b/src/core/core.vcxproj.filters @@ -57,6 +57,7 @@ + @@ -116,5 +117,6 @@ + \ No newline at end of file diff --git a/src/core/pch.cpp b/src/core/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/src/core/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/src/core/pch.h b/src/core/pch.h new file mode 100644 index 000000000..14471a8b4 --- /dev/null +++ b/src/core/pch.h @@ -0,0 +1,8 @@ +#pragma once +#include "types.h" +#include +#include +#include +#include +#include +#include diff --git a/src/duckstation-qt/CMakeLists.txt b/src/duckstation-qt/CMakeLists.txt index d75e7af07..0bb4eaaad 100644 --- a/src/duckstation-qt/CMakeLists.txt +++ b/src/duckstation-qt/CMakeLists.txt @@ -124,6 +124,7 @@ qt5_add_translation(QM_FILES ${TS_FILES}) add_executable(duckstation-qt ${SRCS} ${QM_FILES}) target_include_directories(duckstation-qt PRIVATE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}") target_link_libraries(duckstation-qt PRIVATE frontend-common core common imgui glad minizip scmversion vulkan-loader Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) +target_precompile_headers(duckstation-qt PRIVATE pch.h) if(WIN32) # We want a Windows subsystem application not console. diff --git a/src/duckstation-qt/duckstation-qt.vcxproj b/src/duckstation-qt/duckstation-qt.vcxproj index b90bcd023..56f963feb 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj +++ b/src/duckstation-qt/duckstation-qt.vcxproj @@ -72,6 +72,20 @@ + + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + @@ -116,6 +130,7 @@ + @@ -528,8 +543,7 @@ - - + Use Level4 Disabled WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -540,6 +554,8 @@ false stdcpp17 /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -550,8 +566,7 @@ - - + Use Level4 Disabled WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -562,6 +577,8 @@ false stdcpp17 /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -572,8 +589,7 @@ - - + Use Level4 Disabled WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -584,6 +600,8 @@ false stdcpp17 /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -594,8 +612,7 @@ - - + Use Level4 Disabled WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -608,6 +625,8 @@ stdcpp17 false /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -618,8 +637,7 @@ - - + Use Level4 Disabled WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -632,6 +650,8 @@ stdcpp17 false /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -642,8 +662,7 @@ - - + Use Level4 Disabled WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -656,6 +675,8 @@ stdcpp17 false /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -667,8 +688,7 @@ Level4 - - + Use MaxSpeed true WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -677,6 +697,8 @@ false stdcpp17 /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -691,8 +713,7 @@ Level4 - - + Use MaxSpeed true WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -702,6 +723,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -716,8 +739,7 @@ Level4 - - + Use MaxSpeed true WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -726,6 +748,8 @@ false stdcpp17 /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -740,8 +764,7 @@ Level4 - - + Use MaxSpeed true WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -750,6 +773,8 @@ false stdcpp17 /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -764,8 +789,7 @@ Level4 - - + Use MaxSpeed true WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -775,6 +799,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows @@ -789,8 +815,7 @@ Level4 - - + Use MaxSpeed true WITH_DISCORD_PRESENCE=1;WITH_SDL2=1;WITH_IMGUI=1;WITH_RECOMPILER=1;WITH_MMAP_FASTMEM=1;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) @@ -800,6 +825,8 @@ stdcpp17 true /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Windows diff --git a/src/duckstation-qt/duckstation-qt.vcxproj.filters b/src/duckstation-qt/duckstation-qt.vcxproj.filters index 2d6acace6..ca5fa01d0 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj.filters +++ b/src/duckstation-qt/duckstation-qt.vcxproj.filters @@ -77,12 +77,14 @@ + + diff --git a/src/duckstation-qt/pch.cpp b/src/duckstation-qt/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/src/duckstation-qt/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/src/duckstation-qt/pch.h b/src/duckstation-qt/pch.h new file mode 100644 index 000000000..836666e4c --- /dev/null +++ b/src/duckstation-qt/pch.h @@ -0,0 +1,26 @@ +#pragma once +#include "core/types.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/frontend-common/CMakeLists.txt b/src/frontend-common/CMakeLists.txt index 29da659b7..5b1a9e660 100644 --- a/src/frontend-common/CMakeLists.txt +++ b/src/frontend-common/CMakeLists.txt @@ -40,6 +40,7 @@ add_library(frontend-common ) target_link_libraries(frontend-common PUBLIC core common glad vulkan-loader cubeb imgui simpleini tinyxml2 scmversion) +target_precompile_headers(frontend-common PRIVATE pch.h) if(WIN32) target_sources(frontend-common PRIVATE diff --git a/src/frontend-common/frontend-common.vcxproj b/src/frontend-common/frontend-common.vcxproj index cd93015fa..065503819 100644 --- a/src/frontend-common/frontend-common.vcxproj +++ b/src/frontend-common/frontend-common.vcxproj @@ -100,6 +100,20 @@ + + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + Create + @@ -128,6 +142,7 @@ + @@ -339,8 +354,7 @@ - - + Use Level3 Disabled WITH_IMGUI=1;WITH_SDL2=1;WITH_DISCORD_PRESENCE=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) @@ -352,6 +366,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -367,8 +383,7 @@ - - + Use Level3 Disabled WITH_IMGUI=1;WITH_SDL2=1;WITH_DISCORD_PRESENCE=1;_ITERATOR_DEBUG_LEVEL=1;WIN32;_DEBUGFAST;_DEBUG;_LIB;%(PreprocessorDefinitions) @@ -383,6 +398,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -398,8 +415,7 @@ - - + Use Level3 Disabled WITH_IMGUI=1;WITH_SDL2=1;WITH_DISCORD_PRESENCE=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) @@ -411,6 +427,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -426,8 +444,7 @@ - - + Use Level3 Disabled WITH_IMGUI=1;WITH_SDL2=1;WITH_DISCORD_PRESENCE=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) @@ -439,6 +456,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -454,8 +473,7 @@ - - + Use Level3 Disabled WITH_IMGUI=1;WITH_SDL2=1;WITH_DISCORD_PRESENCE=1;_ITERATOR_DEBUG_LEVEL=1;WIN32;_DEBUGFAST;_DEBUG;_LIB;%(PreprocessorDefinitions) @@ -470,6 +488,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -485,8 +505,7 @@ - - + Use Level3 Disabled WITH_IMGUI=1;WITH_SDL2=1;WITH_DISCORD_PRESENCE=1;_ITERATOR_DEBUG_LEVEL=1;WIN32;_DEBUGFAST;_DEBUG;_LIB;%(PreprocessorDefinitions) @@ -501,6 +520,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -517,8 +538,7 @@ Level3 - - + Use MaxSpeed true true @@ -531,6 +551,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -550,8 +572,7 @@ Level3 - - + Use MaxSpeed true true @@ -564,6 +585,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -582,8 +605,7 @@ Level3 - - + Use MaxSpeed true true @@ -596,6 +618,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -615,8 +639,7 @@ Level3 - - + Use MaxSpeed true true @@ -629,6 +652,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -648,8 +673,7 @@ Level3 - - + Use MaxSpeed true true @@ -662,6 +686,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console @@ -680,8 +706,7 @@ Level3 - - + Use MaxSpeed true true @@ -694,6 +719,8 @@ true $(IntDir)/%(RelativeDir)/ /Zo /utf-8 %(AdditionalOptions) + pch.h + pch.h Console diff --git a/src/frontend-common/frontend-common.vcxproj.filters b/src/frontend-common/frontend-common.vcxproj.filters index 2665afae2..744cbbea4 100644 --- a/src/frontend-common/frontend-common.vcxproj.filters +++ b/src/frontend-common/frontend-common.vcxproj.filters @@ -27,6 +27,7 @@ + @@ -55,6 +56,7 @@ + diff --git a/src/frontend-common/imgui_impl_opengl3.cpp b/src/frontend-common/imgui_impl_opengl3.cpp index c7fdb4baa..0d792352f 100644 --- a/src/frontend-common/imgui_impl_opengl3.cpp +++ b/src/frontend-common/imgui_impl_opengl3.cpp @@ -63,10 +63,6 @@ // ES 3.0 300 "#version 300 es" = WebGL 2.0 //---------------------------------------- -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - #include "imgui.h" #include "imgui_impl_opengl3.h" #include @@ -126,8 +122,13 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version) io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes. IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(g_GlslVersionString)); +#ifndef _MSC_VER strcpy(g_GlslVersionString, glsl_version); strcat(g_GlslVersionString, "\n"); +#else + strncpy_s(g_GlslVersionString, sizeof(g_GlslVersionString), glsl_version, _TRUNCATE); + strncpy_s(g_GlslVersionString, sizeof(g_GlslVersionString), "\n", _TRUNCATE); +#endif return ImGui_ImplOpenGL3_CreateDeviceObjects(); } @@ -363,7 +364,11 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects() // Parse GLSL version string int glsl_version = 130; +#ifndef _MSC_VER sscanf(g_GlslVersionString, "#version %d", &glsl_version); +#else + sscanf_s(g_GlslVersionString, "#version %d", &glsl_version); +#endif const GLchar* vertex_shader_glsl_120 = "uniform mat4 ProjMtx;\n" diff --git a/src/frontend-common/pch.cpp b/src/frontend-common/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/src/frontend-common/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/src/frontend-common/pch.h b/src/frontend-common/pch.h new file mode 100644 index 000000000..c63d2683e --- /dev/null +++ b/src/frontend-common/pch.h @@ -0,0 +1,2 @@ +#pragma once +#include "core/pch.h"