Skip to content

Commit 874d6c8

Browse files
committed
fix compiler error
1 parent f505370 commit 874d6c8

8 files changed

Lines changed: 14 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(Piccolo VERSION 0.1.0)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
78
set(BUILD_SHARED_LIBS OFF)
89

910
include(CMakeDependentOption)

engine/3rdparty/JoltPhysics/Build/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL
4242
endif()
4343

4444
# Set general compiler flags
45-
set(CMAKE_CXX_FLAGS "/std:c++17 /Zc:__cplusplus /GR- /Gm- /Wall /WX /EHsc /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline /Zi /DWIN32 /D_WINDOWS /DUNICODE /D_UNICODE")
45+
set(CMAKE_CXX_FLAGS "/std:c++17 /Zc:__cplusplus /GR- /Gm- /Wall /WX /Wv:18 /EHsc /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline /Zi /DWIN32 /D_WINDOWS /DUNICODE /D_UNICODE")
4646
# Set compiler flags for various configurations
4747
set(CMAKE_CXX_FLAGS_DEBUG "/GS /Od /Ob0 /RTC1")
4848
set(CMAKE_CXX_FLAGS_RELEASE "/GS- /GL /Gy /O2 /Oi /Ot")

engine/3rdparty/JoltPhysics/Jolt/Core/JobSystemThreadPool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <Jolt/Core/FixedSizeFreeList.h>
88

99
JPH_SUPPRESS_WARNINGS_STD_BEGIN
10+
#include <chrono>
1011
#include <thread>
1112
#include <mutex>
1213
#include <condition_variable>

engine/3rdparty/JoltPhysics/Jolt/Jolt.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,12 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
385385
set(JOLT_PHYSICS_SRC_FILES ${JOLT_PHYSICS_SRC_FILES} ${JOLT_PHYSICS_ROOT}/Jolt.natvis)
386386
endif()
387387

388-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
389-
# Enable Precompiled Headers for Jolt
390-
set_source_files_properties(${JOLT_PHYSICS_SRC_FILES} PROPERTIES COMPILE_FLAGS "/YuJolt/Jolt.h")
391-
set(JOLT_PHYSICS_SRC_FILES ${JOLT_PHYSICS_SRC_FILES} ${JOLT_PHYSICS_ROOT}/pch.cpp)
392-
set_source_files_properties(${JOLT_PHYSICS_ROOT}/pch.cpp PROPERTIES COMPILE_FLAGS "/YcJolt/Jolt.h")
393-
endif()
388+
# if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
389+
# # Enable Precompiled Headers for Jolt - DISABLED to fix build issues
390+
# # set_source_files_properties(${JOLT_PHYSICS_SRC_FILES} PROPERTIES COMPILE_FLAGS "/YuJolt/Jolt.h")
391+
# # set(JOLT_PHYSICS_SRC_FILES ${JOLT_PHYSICS_SRC_FILES} ${JOLT_PHYSICS_ROOT}/pch.cpp)
392+
# # set_source_files_properties(${JOLT_PHYSICS_ROOT}/pch.cpp PROPERTIES COMPILE_FLAGS "/YcJolt/Jolt.h")
393+
# endif()
394394

395395
# Group source files
396396
source_group(TREE ${JOLT_PHYSICS_ROOT} FILES ${JOLT_PHYSICS_SRC_FILES})

engine/3rdparty/tinyobjloader/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#This configures the Cmake system with multiple properties, depending
33
#on the platform and configuration it is set to build in.
44
project(tinyobjloader)
5-
cmake_minimum_required(VERSION 3.2)
5+
cmake_minimum_required(VERSION 3.20)
66
set(TINYOBJLOADER_SOVERSION 2)
77
set(TINYOBJLOADER_VERSION 2.0.0-rc.9)
88

engine/source/editor/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if(ENABLE_PHYSICS_DEBUG_RENDERER)
4141
)
4242
endif()
4343

44-
add_custom_command(TARGET ${TARGET_NAME} ${POST_BUILD_COMMANDS})
44+
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD ${POST_BUILD_COMMANDS})
4545

4646
#precompile
4747
#set global vari used by precompile

engine/source/runtime/function/framework/component/lua/lua_component.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ namespace Piccolo
7979
else
8080
{
8181
LOG_ERROR("Can't find target field.");
82+
throw std::runtime_error("Can't find target field.");
8283
}
8384
}
8485

engine/source/runtime/function/render/debugdraw/debug_draw_font.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Piccolo
1616
FILE* fontFile = fopen(fontFilePath, "rb");
1717
if (fontFile == NULL)
1818
{
19-
std::runtime_error("debug draw cannot open font.ttf");
19+
throw std::runtime_error("debug draw cannot open font.ttf");
2020
}
2121
fseek(fontFile, 0, SEEK_END);
2222
uint64_t size = ftell(fontFile);
@@ -29,7 +29,7 @@ namespace Piccolo
2929

3030
if (!stbtt_InitFont(&fontInfo, fontBuffer, 0))
3131
{
32-
std::runtime_error("debug draw stb init font failed\n");
32+
throw std::runtime_error("debug draw stb init font failed\n");
3333
}
3434

3535
unsigned char* bitmap = (unsigned char*)calloc(m_bitmap_w * m_bitmap_h, sizeof(unsigned char));

0 commit comments

Comments
 (0)