Moved private headers to `src` directory

This commit is contained in:
Joel Höner 2017-07-03 04:16:38 +02:00
parent d12059e043
commit 7ba6ea0596
19 changed files with 21 additions and 21 deletions

2
.gitignore vendored
View File

@ -80,3 +80,5 @@ CTestTestfile.cmake
# MacOS # MacOS
.DS_Store .DS_Store
build*
.vs

View File

@ -60,7 +60,9 @@ endif ()
add_library("Zydis") add_library("Zydis")
target_include_directories("Zydis" PUBLIC "include/" ${PROJECT_BINARY_DIR}) target_include_directories("Zydis"
PUBLIC "include" ${PROJECT_BINARY_DIR}
PRIVATE "src")
target_compile_definitions("Zydis" PRIVATE "_CRT_SECURE_NO_WARNINGS" "ZYDIS_EXPORTS") target_compile_definitions("Zydis" PRIVATE "_CRT_SECURE_NO_WARNINGS" "ZYDIS_EXPORTS")
generate_export_header("Zydis" BASE_NAME "ZYDIS" EXPORT_FILE_NAME "ZydisExportConfig.h") generate_export_header("Zydis" BASE_NAME "ZYDIS" EXPORT_FILE_NAME "ZydisExportConfig.h")
@ -82,7 +84,7 @@ target_sources("Zydis"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Decoder.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Decoder.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Defines.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Defines.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/InstructionInfo.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/DecoderTypes.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Mnemonic.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Mnemonic.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Register.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Register.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Status.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Status.h"
@ -90,7 +92,7 @@ target_sources("Zydis"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h"
PRIVATE PRIVATE
"include/Zydis/Internal/InstructionTable.h" "src/InstructionTable.h"
"src/Decoder.c" "src/Decoder.c"
"src/Formatter.c" "src/Formatter.c"
"src/InstructionTable.c" "src/InstructionTable.c"
@ -125,7 +127,7 @@ if (ZYDIS_BUILD_EXAMPLES)
"examples/FormatterHooks.c" "examples/FormatterHooks.c"
"examples/FormatHelper.h") "examples/FormatHelper.h")
target_link_libraries("FormatterHooks" "Zydis") target_link_libraries("FormatterHooks" "Zydis")
set_target_properties ("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter") set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter")
target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif () endif ()

View File

@ -37,7 +37,6 @@
#include <Zydis/Zydis.h> #include <Zydis/Zydis.h>
#include "FormatHelper.h" #include "FormatHelper.h"
#include <stdlib.h> #include <stdlib.h>
#include <time.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Static data */ /* Static data */
@ -214,11 +213,8 @@ void disassembleBuffer(ZydisInstructionDecoder* decoder, uint8_t* data, size_t l
/* Entry point */ /* Entry point */
/* ============================================================================================== */ /* ============================================================================================== */
#include <Zydis/Internal/InstructionTable.h>
int main() int main()
{ {
uint8_t data[] = uint8_t data[] =
{ {
// cmpps xmm1, xmm4, 0x03 // cmpps xmm1, xmm4, 0x03

View File

@ -30,7 +30,7 @@
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/Types.h> #include <Zydis/Types.h>
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h> #include <Zydis/DecoderTypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -29,7 +29,7 @@
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h> #include <Zydis/DecoderTypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -43,7 +43,7 @@ extern "C" {
*/ */
typedef uint16_t ZydisInstructionMnemonic; typedef uint16_t ZydisInstructionMnemonic;
#include <Zydis/Internal/MnemonicDefines.inc> #include <Zydis/Generated/MnemonicDefines.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Exported functions */ /* Exported functions */

View File

@ -30,7 +30,7 @@
#include <stdint.h> #include <stdint.h>
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h> #include <Zydis/DecoderTypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -32,7 +32,7 @@
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/Mnemonic.h> #include <Zydis/Mnemonic.h>
#include <Zydis/Register.h> #include <Zydis/Register.h>
#include <Zydis/InstructionInfo.h> #include <Zydis/DecoderTypes.h>
#include <Zydis/Decoder.h> #include <Zydis/Decoder.h>
#include <Zydis/Formatter.h> #include <Zydis/Formatter.h>
#include <Zydis/Utils.h> #include <Zydis/Utils.h>

View File

@ -27,7 +27,7 @@
#include <string.h> #include <string.h>
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/Decoder.h> #include <Zydis/Decoder.h>
#include <Zydis/Internal/InstructionTable.h> #include <InstructionTable.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Internal enums and types */ /* Internal enums and types */

View File

@ -25,7 +25,7 @@
***************************************************************************************************/ ***************************************************************************************************/
#include <assert.h> #include <assert.h>
#include <Zydis/Internal/InstructionTable.h> #include <InstructionTable.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Data tables */ /* Data tables */
@ -286,7 +286,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
/* Physical instruction encodings */ /* Physical instruction encodings */
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
#include <Zydis/Internal/InstructionClassMap.inc> #include <Generated/InstructionClassMap.inc>
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Instruction tree */ /* Instruction tree */
@ -299,7 +299,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
#define ZYDIS_DEFINITION(encoding, instrclass, id) \ #define ZYDIS_DEFINITION(encoding, instrclass, id) \
{ ZYDIS_NODETYPE_DEFINITION_MASK | instrclass, (encoding << 13) | id } { ZYDIS_NODETYPE_DEFINITION_MASK | instrclass, (encoding << 13) | id }
#include <Zydis/Internal/InstructionFilters.inc> #include <Generated/InstructionFilters.inc>
#undef ZYDIS_INVALID #undef ZYDIS_INVALID
#undef ZYDIS_FILTER #undef ZYDIS_FILTER
@ -309,7 +309,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
/* Instruction definitions */ /* Instruction definitions */
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
#include <Zydis/Internal/InstructionDefinitions.inc> #include <Generated/InstructionDefinitions.inc>
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -320,7 +320,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
#define ZYDIS_OPERAND_DEFINITION(type, encoding, access) \ #define ZYDIS_OPERAND_DEFINITION(type, encoding, access) \
{ type, encoding, access } { type, encoding, access }
#include <Zydis/Internal/OperandDefinitions.inc> #include <Generated/OperandDefinitions.inc>
#undef ZYDIS_OPERAND_DEFINITION #undef ZYDIS_OPERAND_DEFINITION

View File

@ -29,7 +29,7 @@
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/Mnemonic.h> #include <Zydis/Mnemonic.h>
#include <Zydis/InstructionInfo.h> #include <Zydis/DecoderTypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -30,7 +30,7 @@
/* Mnemonic strings */ /* Mnemonic strings */
/* ============================================================================================== */ /* ============================================================================================== */
#include <Zydis/Internal/MnemonicStrings.inc> #include <Generated/MnemonicStrings.inc>
/* ============================================================================================== */ /* ============================================================================================== */
/* Exported functions */ /* Exported functions */