diff --git a/CMakeLists.txt b/CMakeLists.txt index 29298395..7dec89bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,36 +196,7 @@ SET( CMAKE_CXX_FLAGS_RELEASE "-O3") SET( CMAKE_C_FLAGS_DEBUG "-g -Wall") SET( CMAKE_CXX_FLAGS_DEBUG "-g -Wall") -# Source files definition -SET(SRC_FEX - fex/7z_C/7zAlloc.c - fex/7z_C/7zBuf.c - fex/7z_C/7zCrc.c - fex/7z_C/7zCrcOpt.c - fex/7z_C/7zDec.c - fex/7z_C/7zIn.c - fex/7z_C/7zStream.c - fex/7z_C/Bcj2.c - fex/7z_C/Bra86.c - fex/7z_C/Bra.c - fex/7z_C/CpuArch.c - fex/7z_C/Lzma2Dec.c - fex/7z_C/LzmaDec.c - fex/7z_C/Ppmd7.c - fex/7z_C/Ppmd7Dec.c - fex/fex/Binary_Extractor.cpp - fex/fex/blargg_common.cpp - fex/fex/blargg_errors.cpp - fex/fex/Data_Reader.cpp - fex/fex/fex.cpp - fex/fex/File_Extractor.cpp - fex/fex/Gzip_Extractor.cpp - fex/fex/Gzip_Reader.cpp - fex/fex/Rar_Extractor.cpp - fex/fex/Zip7_Extractor.cpp - fex/fex/Zip_Extractor.cpp - fex/fex/Zlib_Inflater.cpp -) +add_subdirectory (fex) SET(SRC_MAIN src/Util.cpp @@ -339,7 +310,6 @@ endif( ENABLE_DEBUGGER ) INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} - fex ${PNG_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ) @@ -350,11 +320,6 @@ IF( ENABLE_FFMPEG ) ) ENDIF( ENABLE_FFMPEG ) -ADD_LIBRARY( - fex - ${SRC_FEX} -) - ADD_LIBRARY ( vbamcore ${PROJECT_SRCS} @@ -399,12 +364,7 @@ IF( ENABLE_GTK ) ENDIF( ENABLE_GTK ) IF( ENABLE_WX ) - # since this has generated source files, it's easier to just - # make from the subdir - # otherwise out-of-tree builds have trouble - add_subdirectory(src/wx) - ENDIF( ENABLE_WX ) if( ENABLE_GTK OR ENABLE_WX ) diff --git a/fex/CMakeLists.txt b/fex/CMakeLists.txt new file mode 100644 index 00000000..bf9d760b --- /dev/null +++ b/fex/CMakeLists.txt @@ -0,0 +1,42 @@ +#Do not use this file directly. Always use the top level CMakeLists.txt file +#File extractors so the user doesn't have to extract the rom before playing it + +# Source files definition +SET(SRC_FEX + 7z_C/7zAlloc.c + 7z_C/7zBuf.c + 7z_C/7zCrc.c + 7z_C/7zCrcOpt.c + 7z_C/7zDec.c + 7z_C/7zIn.c + 7z_C/7zStream.c + 7z_C/Bcj2.c + 7z_C/Bra86.c + 7z_C/Bra.c + 7z_C/CpuArch.c + 7z_C/Lzma2Dec.c + 7z_C/LzmaDec.c + 7z_C/Ppmd7.c + 7z_C/Ppmd7Dec.c + fex/Binary_Extractor.cpp + fex/blargg_common.cpp + fex/blargg_errors.cpp + fex/Data_Reader.cpp + fex/fex.cpp + fex/File_Extractor.cpp + fex/Gzip_Extractor.cpp + fex/Gzip_Reader.cpp + fex/Rar_Extractor.cpp + fex/Zip7_Extractor.cpp + fex/Zip_Extractor.cpp + fex/Zlib_Inflater.cpp +) + +INCLUDE_DIRECTORIES( + . +) + +ADD_LIBRARY( + fex + ${SRC_FEX} +) diff --git a/src/Util.cpp b/src/Util.cpp index 25f3df4b..63917684 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -18,7 +18,7 @@ extern "C" { #include "gba/RTC.h" #include "common/Port.h" -#include "fex/fex.h" +#include "../fex/fex/fex.h" extern "C" { #include "common/memgzio.h"