Move MakeRwys to own lib
This commit is contained in:
parent
a820f7456a
commit
3b2f146679
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -3,5 +3,8 @@
|
||||
"cmake.configureArgs": [
|
||||
"-DIBM=ON"
|
||||
],
|
||||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
|
||||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
|
||||
"files.associations": {
|
||||
"cmath": "cpp"
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,9 @@ set(PLUGIN_NAME GAConnector)
|
||||
|
||||
option(DEBUG "Debug symbols" OFF)
|
||||
|
||||
add_subdirectory(
|
||||
makerwysxp
|
||||
)
|
||||
add_subdirectory(
|
||||
xplugin
|
||||
)
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef GERMANAIRLINESVA_GACONNECTOR_PATHSEGMENT_H
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_PATHSEGMENT_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
@ -54,3 +57,5 @@ class PathSegment
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#ifndef GERMANAIRLINESVA_GACONNECTOR_RECORDINGPATH_H
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_RECORDINGPATH_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
@ -21,4 +24,6 @@ class Path
|
||||
|
||||
std::uint8_t *getBinaryData() { return file.data(); }
|
||||
std::size_t getBinaryLength() { return file.size(); }
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
92
makerwysxp/CMakeLists.txt
Normal file
92
makerwysxp/CMakeLists.txt
Normal file
@ -0,0 +1,92 @@
|
||||
file(GLOB makerwysxp CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/makerwysxp/*.cpp)
|
||||
|
||||
add_library(makerwysxp SHARED
|
||||
${makerwysxp}
|
||||
)
|
||||
|
||||
target_include_directories(makerwysxp PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/makerwysxp/include
|
||||
${CMAKE_SOURCE_DIR}/file
|
||||
)
|
||||
|
||||
set_target_properties(makerwysxp PROPERTIES
|
||||
PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/makerwysxp/include
|
||||
)
|
||||
target_compile_definitions(makerwysxp PRIVATE
|
||||
_USE_MATH_DEFINES
|
||||
)
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
-Wall
|
||||
-Wextra
|
||||
-pedantic
|
||||
)
|
||||
if(DEBUG)
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
-g
|
||||
)
|
||||
target_link_options(makerwysxp PRIVATE
|
||||
-g
|
||||
)
|
||||
else()
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
-O2
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
message("Building makerwysxp for MacOSX Universal into ${PROJECT_BINARY_DIR}/${PLUGIN_NAME}/${BIT}")
|
||||
|
||||
set_target_properties(makerwysxp PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}"
|
||||
BUILD_WITH_INSTALL_NAME_DIR TRUE
|
||||
)
|
||||
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
"SHELL:-arch i386"
|
||||
"SHELL:-arch x86_64"
|
||||
)
|
||||
target_link_options(makerwysxp PRIVATE
|
||||
"SHELL:-arch i386"
|
||||
"SHELL:-arch x86_64"
|
||||
)
|
||||
target_link_libraries(makerwysxp PRIVATE
|
||||
"-framework Security"
|
||||
)
|
||||
elseif(UNIX)
|
||||
message("Building makerwysxp for Linux ${BIT} into ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}")
|
||||
|
||||
set_target_properties(makerwysxp PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}"
|
||||
)
|
||||
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
-nodefaultlibs
|
||||
)
|
||||
if(BIT STREQUAL "32")
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
-m32
|
||||
)
|
||||
target_link_options(makerwysxp PRIVATE
|
||||
-m32
|
||||
)
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
message("Building makerwysxp for Windows ${BIT} into ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}")
|
||||
|
||||
set_target_properties(makerwysxp PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}"
|
||||
)
|
||||
|
||||
if(DEBUG)
|
||||
target_compile_options(makerwysxp PRIVATE
|
||||
-gcodeview
|
||||
)
|
||||
target_link_options(makerwysxp PRIVATE
|
||||
-Wl,-pdb=
|
||||
)
|
||||
endif()
|
||||
target_link_options(makerwysxp PRIVATE
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
endif()
|
||||
@ -4,11 +4,11 @@ file(GLOB file CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/file/*.cpp)
|
||||
add_library(germanairlinesva_xplugin SHARED
|
||||
${socket}
|
||||
${file}
|
||||
makeRwysXP.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_include_directories(germanairlinesva_xplugin PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/makerwysxp/include
|
||||
${CMAKE_SOURCE_DIR}/socket/include
|
||||
${CMAKE_SOURCE_DIR}/XPSDK/CHeaders
|
||||
${CMAKE_SOURCE_DIR}/nlohmann
|
||||
@ -133,3 +133,7 @@ elseif(WIN32)
|
||||
xPluginWin.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(germanairlinesva_xplugin PRIVATE
|
||||
makerwysxp
|
||||
)
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#include <cstdio>
|
||||
#include <windows.h>
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
BOOL APIENTRY DllMain(HANDLE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved)
|
||||
@ -15,3 +17,5 @@ BOOL APIENTRY DllMain(HANDLE hModule,
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user