mirror of https://github.com/libAthena/athena.git
windows packaging and CMake adjustments
This commit is contained in:
parent
4f8df65a3d
commit
55adeec69c
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
|
@ -152,11 +152,10 @@ add_library(AthenaZelda
|
||||||
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
|
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
|
||||||
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
|
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
|
||||||
if(WIN32 AND NOT CYGWIN)
|
if(WIN32 AND NOT CYGWIN)
|
||||||
set(DEF_INSTALL_CMAKE_DIR cmake)
|
set(INSTALL_CMAKE_DIR cmake)
|
||||||
else()
|
else()
|
||||||
set(DEF_INSTALL_CMAKE_DIR lib/cmake/Athena)
|
set(INSTALL_CMAKE_DIR lib/cmake/Athena)
|
||||||
endif()
|
endif()
|
||||||
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
|
|
||||||
|
|
||||||
# Make relative paths absolute (needed later on)
|
# Make relative paths absolute (needed later on)
|
||||||
foreach(p LIB INCLUDE CMAKE)
|
foreach(p LIB INCLUDE CMAKE)
|
||||||
|
@ -169,14 +168,15 @@ foreach(p LIB INCLUDE CMAKE)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Define installs
|
# Define installs
|
||||||
install(DIRECTORY include/ DESTINATION ${INSTALL_INCLUDE_DIR}/Athena)
|
install(DIRECTORY include/ DESTINATION ${INSTALL_INCLUDE_DIR}/Athena COMPONENT Athena)
|
||||||
install(TARGETS AthenaCore AthenaSakura AthenaWiiSave AthenaZelda
|
install(TARGETS AthenaCore AthenaSakura AthenaWiiSave AthenaZelda
|
||||||
DESTINATION ${INSTALL_LIB_DIR} EXPORT AthenaTargets)
|
DESTINATION ${INSTALL_LIB_DIR} EXPORT AthenaTargets COMPONENT Athena)
|
||||||
if(WIN32 AND NOT CYGWIN)
|
if(WIN32 AND NOT CYGWIN)
|
||||||
install(FILES Athena.ico DESTINATION ${INSTALL_LIB_DIR})
|
install(FILES Athena.ico DESTINATION ${INSTALL_LIB_DIR} COMPONENT Athena)
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
install(FILES lib/pkgconfig/libAthena.pc
|
configure_file(libAthena.pc.in libAthena.pc @ONLY)
|
||||||
DESTINATION ${INSTALL_LIB_DIR}/pkgconfig)
|
install(FILES ${PROJECT_BINARY_DIR}/libAthena.pc
|
||||||
|
DESTINATION ${INSTALL_LIB_DIR}/pkgconfig COMPONENT Athena)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##################
|
##################
|
||||||
|
@ -209,10 +209,18 @@ configure_file(AthenaConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/AthenaConfigV
|
||||||
install(FILES
|
install(FILES
|
||||||
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/AthenaConfig.cmake"
|
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/AthenaConfig.cmake"
|
||||||
"${PROJECT_BINARY_DIR}/AthenaConfigVersion.cmake"
|
"${PROJECT_BINARY_DIR}/AthenaConfigVersion.cmake"
|
||||||
DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)
|
DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Athena)
|
||||||
|
|
||||||
# Install the export set for use with the install-tree
|
# Install the export set for use with the install-tree
|
||||||
install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)
|
install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Athena)
|
||||||
|
|
||||||
|
################
|
||||||
|
# atdna import #
|
||||||
|
################
|
||||||
|
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/atdna/")
|
||||||
|
add_subdirectory(atdna)
|
||||||
|
endif()
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# CPack #
|
# CPack #
|
||||||
|
@ -220,7 +228,7 @@ install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)
|
||||||
|
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Athena")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Athena")
|
||||||
set(CPACK_PACKAGE_VENDOR "2015 Antidote / Jackoalan")
|
set(CPACK_PACKAGE_VENDOR "Antidote / Jackoalan")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${ATHENA_MAJOR_VERSION})
|
set(CPACK_PACKAGE_VERSION_MAJOR ${ATHENA_MAJOR_VERSION})
|
||||||
|
@ -230,12 +238,15 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "Athena")
|
||||||
if(WIN32 AND NOT UNIX)
|
if(WIN32 AND NOT UNIX)
|
||||||
# There is a bug in NSI that does not handle full unix paths properly. Make
|
# There is a bug in NSI that does not handle full unix paths properly. Make
|
||||||
# sure there is at least one set of four (4) backlasshes.
|
# sure there is at least one set of four (4) backlasshes.
|
||||||
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/Athena.ico")
|
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Athena")
|
||||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "Athena.ico")
|
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\AthenaNSIS.bmp")
|
||||||
|
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||||
|
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\Athena.ico")
|
||||||
|
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\Athena.ico")
|
||||||
|
set(CPACK_NSIS_INSTALLED_ICON_NAME "Uninstall.exe")
|
||||||
set(CPACK_NSIS_DISPLAY_NAME "Athena")
|
set(CPACK_NSIS_DISPLAY_NAME "Athena")
|
||||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://libathena.github.io")
|
set(CPACK_NSIS_URL_INFO_ABOUT "http://libathena.github.io")
|
||||||
set(CPACK_NSIS_CONTACT "antidote.crk@gmail.com")
|
set(CPACK_NSIS_CONTACT "antidote.crk@gmail.com")
|
||||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
|
||||||
endif()
|
endif()
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
if(NOT WIN32)
|
||||||
find_library(LZO_LIB lzo2)
|
find_library(LZO_LIB lzo2)
|
||||||
if(LZO_LIB STREQUAL LZO_LIB-NOTFOUND)
|
endif()
|
||||||
|
if(WIN32 OR LZO_LIB STREQUAL LZO_LIB-NOTFOUND)
|
||||||
|
include_directories(include)
|
||||||
|
message("-- Using Athena's built-in lzo")
|
||||||
add_library(lzo2
|
add_library(lzo2
|
||||||
src/lzo1.c
|
src/lzo1.c
|
||||||
src/lzo1_99.c
|
src/lzo1_99.c
|
||||||
|
@ -73,7 +77,9 @@ add_library(lzo2
|
||||||
include/lzo/lzoconf.h
|
include/lzo/lzoconf.h
|
||||||
include/lzo/lzodefs.h
|
include/lzo/lzodefs.h
|
||||||
include/lzo/lzoutil.h)
|
include/lzo/lzoutil.h)
|
||||||
install(DIRECTORY include/lzo DESTINATION include/lzo)
|
if(WIN32 AND NOT UNIX)
|
||||||
install(TARGETS lzo2 DESTINATION lib)
|
install(DIRECTORY include/lzo DESTINATION include COMPONENT lzo2)
|
||||||
|
install(TARGETS lzo2 DESTINATION lib COMPONENT lzo2)
|
||||||
|
endif()
|
||||||
set(LZO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE PATH "LZO include path" FORCE)
|
set(LZO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE PATH "LZO include path" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
if(NOT WIN32)
|
||||||
find_package(ZLIB)
|
find_package(ZLIB)
|
||||||
if(NOT ZLIB_FOUND)
|
endif()
|
||||||
|
if(WIN32 OR NOT ZLIB_FOUND)
|
||||||
|
message("-- Using Athena's built-in zlib")
|
||||||
add_library(z
|
add_library(z
|
||||||
adler32.c
|
adler32.c
|
||||||
compress.c
|
compress.c
|
||||||
|
@ -23,7 +26,9 @@ add_library(z
|
||||||
zconf.h
|
zconf.h
|
||||||
zlib.h
|
zlib.h
|
||||||
zutil.h)
|
zutil.h)
|
||||||
install(FILES zconf.h zlib.h DESTINATION include)
|
if(WIN32 AND NOT UNIX)
|
||||||
install(TARGETS z DESTINATION lib)
|
install(FILES zconf.h zlib.h DESTINATION include COMPONENT zlib)
|
||||||
|
install(TARGETS z DESTINATION lib COMPONENT zlib)
|
||||||
|
endif()
|
||||||
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Zlib include path" FORCE)
|
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Zlib include path" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#ifndef FILESTREAM_HPP
|
#ifndef FILESTREAM_HPP
|
||||||
#define FILESTREAM_HPP
|
#define FILESTREAM_HPP
|
||||||
|
|
||||||
#include "Athena/IStreamReader.hpp"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "Athena/IStreamReader.hpp"
|
||||||
|
|
||||||
namespace Athena
|
namespace Athena
|
||||||
{
|
{
|
||||||
|
|
|
@ -226,7 +226,7 @@ public:
|
||||||
* \return atVec2f The value at the current address
|
* \return atVec2f The value at the current address
|
||||||
* \throw IOException when address is out of range
|
* \throw IOException when address is out of range
|
||||||
*/
|
*/
|
||||||
inline atVec2f readVec3f()
|
inline atVec2f readVec2f()
|
||||||
{
|
{
|
||||||
atVec2f val;
|
atVec2f val;
|
||||||
readUBytesToBuf(&val, 8);
|
readUBytesToBuf(&val, 8);
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#ifndef MEMORYREADER_HPP
|
#ifndef MEMORYREADER_HPP
|
||||||
#define MEMORYREADER_HPP
|
#define MEMORYREADER_HPP
|
||||||
|
|
||||||
#include "Athena/IStreamReader.hpp"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include "Athena/IStreamReader.hpp"
|
||||||
|
|
||||||
namespace Athena
|
namespace Athena
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#ifndef MEMORYWRITER_HPP
|
#ifndef MEMORYWRITER_HPP
|
||||||
#define MEMORYWRITER_HPP
|
#define MEMORYWRITER_HPP
|
||||||
|
|
||||||
#include "Athena/IStreamWriter.hpp"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include "Athena/IStreamWriter.hpp"
|
||||||
|
|
||||||
namespace Athena
|
namespace Athena
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
prefix=/usr
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
includedir=${prefix}/include
|
includedir=${prefix}/include
|
||||||
libdir=${prefix}/lib
|
libdir=${prefix}/lib
|
||||||
|
|
||||||
Name: libAthena
|
Name: libAthena
|
||||||
Description: Basic cross platform IO library
|
Description: Basic cross platform IO library
|
||||||
Version: 2.0.0
|
Version: @ATHENA_VERSION@
|
||||||
Cflags: -I${includedir}/Athena -std=c++11
|
Cflags: -I${includedir}/Athena -std=c++11
|
||||||
Libs: -L${libdir} -lAthenaCore -lAthenaSakura -lAthenaZelda -lAthenaWiiSave
|
Libs: -L${libdir} -lAthenaCore -lAthenaSakura -lAthenaZelda -lAthenaWiiSave
|
||||||
Requires: zlib
|
Requires: zlib
|
14
src/aes.cpp
14
src/aes.cpp
|
@ -1,7 +1,11 @@
|
||||||
#include "aes.hpp"
|
#include "aes.hpp"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#if _WIN32
|
||||||
|
#include <intrin.h>
|
||||||
|
#else
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Athena
|
namespace Athena
|
||||||
{
|
{
|
||||||
|
@ -478,7 +482,7 @@ void SoftwareAES::encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __AES__
|
#if __AES__ || _MSC_VER >= 1800
|
||||||
|
|
||||||
#include <wmmintrin.h>
|
#include <wmmintrin.h>
|
||||||
|
|
||||||
|
@ -598,12 +602,18 @@ public:
|
||||||
static int HAS_AES_NI = -1;
|
static int HAS_AES_NI = -1;
|
||||||
std::unique_ptr<IAES> NewAES()
|
std::unique_ptr<IAES> NewAES()
|
||||||
{
|
{
|
||||||
#if __AES__
|
#if __AES__ || _MSC_VER >= 1800
|
||||||
if (HAS_AES_NI == -1)
|
if (HAS_AES_NI == -1)
|
||||||
{
|
{
|
||||||
|
#if _MSC_VER
|
||||||
|
int info[4];
|
||||||
|
__cpuid(info, 1);
|
||||||
|
HAS_AES_NI = ((info[2] & 0x2000000) != 0);
|
||||||
|
#else
|
||||||
unsigned int a,b,c,d;
|
unsigned int a,b,c,d;
|
||||||
__cpuid(1, a,b,c,d);
|
__cpuid(1, a,b,c,d);
|
||||||
HAS_AES_NI = ((c & 0x2000000) != 0);
|
HAS_AES_NI = ((c & 0x2000000) != 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (HAS_AES_NI)
|
if (HAS_AES_NI)
|
||||||
return std::unique_ptr<IAES>(new NiAES);
|
return std::unique_ptr<IAES>(new NiAES);
|
||||||
|
|
Loading…
Reference in New Issue