@@ -8,6 +8,7 @@ include(MiscUtils)
88
99# Compilation options
1010option (BUILD_SHARED_LIBS "Build shared library, disable for building the static library (default: ON)" ON )
11+ option (LIBLCF_WITH_INI "INI parsing support (inih, required when building EasyRPG Player, default: ON)" ON )
1112option (LIBLCF_WITH_ICU "ICU encoding handling (when disabled only windows-1252 is supported, default: ON)" ON )
1213option (LIBLCF_WITH_XML "XML reading support (expat, default: ON)" ON )
1314option (LIBLCF_UPDATE_MIMEDB "Whether to run update-mime-database after install (default: ON)" ON )
@@ -30,7 +31,6 @@ set(LCF_SOURCES
3031 src/dbarray.cpp
3132 src/dbstring_struct.cpp
3233 src/encoder.cpp
33- src/inireader.cpp
3434 src/ldb_equipment.cpp
3535 src/ldb_eventcommand.cpp
3636 src/ldb_parameters.cpp
@@ -202,7 +202,6 @@ set(LCF_HEADERS
202202 src/lcf/encoder.h
203203 src/lcf/enum_tags.h
204204 src/lcf/flag_set.h
205- src/lcf/inireader.h
206205 src/lcf/ldb/reader.h
207206 src/lcf/lmt/reader.h
208207 src/lcf/lmu/reader.h
@@ -294,6 +293,17 @@ set(LCF_HEADERS
294293 src/lcf/third_party/string_view.h
295294)
296295
296+ set (LCF_SUPPORT_INI 0)
297+ if (LIBLCF_WITH_INI)
298+ list (APPEND LCF_SOURCES
299+ src/inireader.cpp
300+ )
301+ list (APPEND LCF_HEADERS
302+ src/lcf/inireader.h
303+ )
304+ set (LCF_SUPPORT_INI 1)
305+ endif ()
306+
297307add_library (lcf ${LCF_SOURCES} ${LCF_HEADERS} )
298308
299309# IDE source grouping
@@ -344,8 +354,12 @@ set_property(TARGET lcf PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
344354set_property (TARGET lcf PROPERTY EXPORT_NAME liblcf )
345355
346356# inih
347- find_package (inih REQUIRED )
348- target_link_libraries (lcf inih::inih )
357+ if (LCF_SUPPORT_INI)
358+ find_package (inih REQUIRED )
359+ target_link_libraries (lcf inih::inih )
360+ else ()
361+ message (STATUS "inih is disabled. This component is required when building EasyRPG Player." )
362+ endif ()
349363
350364# icu
351365set (LCF_SUPPORT_ICU 0)
0 commit comments