diff --git a/Linker/CMakeLists.txt b/Linker/CMakeLists.txt new file mode 100644 index 0000000..19f808b --- /dev/null +++ b/Linker/CMakeLists.txt @@ -0,0 +1,62 @@ +project(linker) + +add_subdirectory(lib) + +add_library(${PROJECT_NAME} SHARED + "linker_dll.cpp" +) + +target_link_libraries(${PROJECT_NAME} + linker_lib +) + + +if (WIN32) + target_compile_definitions(${PROJECT_NAME} + PRIVATE + _CRT_SECURE_NO_WARNINGS + # windows.h + WIN32_LEAN_AND_MEAN + NOGPICAPMASKS + NOVIRTUALKEYCODES + #NOWINMESSAGES + NOWINSTYLES + NOSYSMETRICS + NOMENUS + NOICONS + NOKEYSTATES + NOSYSCOMMANDS + NORASTEROPS + NOSHOWWINDOW + NOATOM + NOCLIPBOARD + NOCOLOR + NOCTLMGR + NODRAWTEXT + #NOGDI + NOKERNEL + #NOUSER + #NONLS + NOMB + NOMEMMGR + NOMETAFILE + NOMINMAX + #NOMSG + NOOPENFILE + NOSCROLL + NOSERVICE + NOSOUND + #NOTEXTMETRIC + NOWH + NOWINOFFSETS + NOCOMM + NOKANJI + NOHELP + NOPROFILER + NODEFERWINDOWPOS + NOMCX + NOIME + NOMDI + NOINOUT + ) +endif() diff --git a/Linker/lib/CMakeLists.txt b/Linker/lib/CMakeLists.txt new file mode 100644 index 0000000..5eba799 --- /dev/null +++ b/Linker/lib/CMakeLists.txt @@ -0,0 +1,70 @@ +project(linker_lib) + +add_library(${PROJECT_NAME} SHARED + "dlltoexe.cpp" + "dlltoexe.hpp" + "image_util.cpp" + "image_util.hpp" + "linker.cpp" + "linker.hpp" + "std.cpp" + "std.hpp" +) + +target_link_libraries(${PROJECT_NAME} + stdutil +) + +target_include_directories(${PROJECT_NAME} + PUBLIC ${PROJECT_SOURCE_DIR} +) + +if (WIN32) + target_compile_definitions(${PROJECT_NAME} + PRIVATE + _CRT_SECURE_NO_WARNINGS + # windows.h + WIN32_LEAN_AND_MEAN + NOGPICAPMASKS + NOVIRTUALKEYCODES + NOWINMESSAGES + NOWINSTYLES + NOSYSMETRICS + NOMENUS + NOICONS + NOKEYSTATES + NOSYSCOMMANDS + NORASTEROPS + NOSHOWWINDOW + NOATOM + NOCLIPBOARD + NOCOLOR + NOCTLMGR + NODRAWTEXT + NOGDI + NOKERNEL + #NOUSER + NONLS + #NOMB + NOMEMMGR + NOMETAFILE + NOMINMAX + NOMSG + NOOPENFILE + NOSCROLL + NOSERVICE + NOSOUND + NOTEXTMETRIC + NOWH + NOWINOFFSETS + NOCOMM + NOKANJI + NOHELP + NOPROFILER + NODEFERWINDOWPOS + NOMCX + NOIME + NOMDI + NOINOUT + ) +endif() diff --git a/LinkerLib/dlltoexe.cpp b/Linker/lib/dlltoexe.cpp similarity index 95% rename from LinkerLib/dlltoexe.cpp rename to Linker/lib/dlltoexe.cpp index 82630c6..8f7b3d3 100644 --- a/LinkerLib/dlltoexe.cpp +++ b/Linker/lib/dlltoexe.cpp @@ -1,6 +1,8 @@ -#include "std.h" -#include "dlltoexe.h" +#include "std.hpp" +#include "dlltoexe.hpp" + +using namespace std; #pragma pack( push,1 ) struct Head{ diff --git a/LinkerLib/dlltoexe.h b/Linker/lib/dlltoexe.hpp similarity index 100% rename from LinkerLib/dlltoexe.h rename to Linker/lib/dlltoexe.hpp diff --git a/LinkerLib/image_util.cpp b/Linker/lib/image_util.cpp similarity index 99% rename from LinkerLib/image_util.cpp rename to Linker/lib/image_util.cpp index 8b175ed..c821045 100644 --- a/LinkerLib/image_util.cpp +++ b/Linker/lib/image_util.cpp @@ -1,6 +1,8 @@ -#include "std.h" -#include "image_util.h" +#include "std.hpp" +#include "image_util.hpp" + +using namespace std; #ifndef DEMO diff --git a/LinkerLib/image_util.h b/Linker/lib/image_util.hpp similarity index 100% rename from LinkerLib/image_util.h rename to Linker/lib/image_util.hpp diff --git a/LinkerLib/linker.cpp b/Linker/lib/linker.cpp similarity index 98% rename from LinkerLib/linker.cpp rename to Linker/lib/linker.cpp index 37b3f45..c8d2866 100644 --- a/LinkerLib/linker.cpp +++ b/Linker/lib/linker.cpp @@ -1,7 +1,9 @@ -#include "std.h" -#include "linker.h" -#include "image_util.h" +#include "std.hpp" +#include "linker.hpp" +#include "image_util.hpp" + +using namespace std; class BBModule : public Module{ public: diff --git a/LinkerLib/linker.h b/Linker/lib/linker.hpp similarity index 100% rename from LinkerLib/linker.h rename to Linker/lib/linker.hpp diff --git a/Linker/lib/std.cpp b/Linker/lib/std.cpp new file mode 100644 index 0000000..d5f561b --- /dev/null +++ b/Linker/lib/std.cpp @@ -0,0 +1,2 @@ + +#include "std.hpp" diff --git a/LinkerLib/std.h b/Linker/lib/std.hpp similarity index 52% rename from LinkerLib/std.h rename to Linker/lib/std.hpp index 56c8c04..bd90487 100644 --- a/LinkerLib/std.h +++ b/Linker/lib/std.hpp @@ -1,10 +1,5 @@ -#ifndef STD_LINKER_H -#define STD_LINKER_H - -#include "../config/config.h" -#include "../stdutil/stdutil.h" - +#pragma once #include #include #include @@ -12,9 +7,6 @@ #include #include #include +#include "stdutil.hpp" #include - -using namespace std; - -#endif \ No newline at end of file diff --git a/Linker/linker_dll.cpp b/Linker/linker_dll.cpp index 35b99e9..e51303d 100644 --- a/Linker/linker_dll.cpp +++ b/Linker/linker_dll.cpp @@ -1,6 +1,6 @@ -#include "../LinkerLib/std.h" -#include "../LinkerLib/linker.h" +#include "std.hpp" +#include "linker.hpp" #include diff --git a/LinkerLib/std.cpp b/LinkerLib/std.cpp deleted file mode 100644 index 7bc955d..0000000 --- a/LinkerLib/std.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "std.h"