Files
FEX-Emu--FEX/Source/Common/CMakeLists.txt
T
Ryan Houdek 30e3d795da FEX: Consolidate JSON allocators and fix 3691
Fixes #3691

We weren't checking if the file was empty before using its `at` function
member. This was causing an early crash if the config file existed but
was empty.

Consolidates the three locations that copy and pasted the json allocator
tools and adds an empty check for all of them.

Also adds two missing checks to the ThunksDB handler that could have
resulted in the same crash if ThunksDB was an empty file.
2024-06-18 13:31:25 -04:00

21 lines
548 B
CMake

add_subdirectory(cpp-optparse/)
set(NAME Common)
set(SRCS
Config.cpp
ArgumentLoader.cpp
EnvironmentLoader.cpp
JSONPool.cpp
StringUtil.cpp)
if (NOT MINGW_BUILD)
list (APPEND SRCS
FEXServerClient.cpp
FileFormatCheck.cpp)
endif()
add_library(${NAME} STATIC ${SRCS})
target_link_libraries(${NAME} FEXCore_Base cpp-optparse tiny-json json-maker FEXHeaderUtils)
target_include_directories(${NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/External/cpp-optparse/)
target_include_directories(${NAME} PRIVATE ${CMAKE_BINARY_DIR}/generated)