-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
34 lines (27 loc) · 1.25 KB
/
CMakeLists.txt
File metadata and controls
34 lines (27 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.10)
# --- Cross-Compilation Setup ---
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# Project Name
project(NppPluginMendixDatadogCopyPasteCleanup)
# Define the shared library (DLL)
add_library(NppPluginMendixDatadogCopyPasteCleanup SHARED src/main.cpp)
# --- FIX 1: Remove the "lib" prefix ---
set_target_properties(NppPluginMendixDatadogCopyPasteCleanup PROPERTIES PREFIX "")
# Npp Plugins need to start with specific defines
target_compile_definitions(NppPluginMendixDatadogCopyPasteCleanup PRIVATE UNICODE _UNICODE _WIN64)
# Link standard windows libraries AND force static linking for MinGW internals
target_link_libraries(NppPluginMendixDatadogCopyPasteCleanup
PRIVATE
shlwapi
-static
-static-libgcc
-static-libstdc++
-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive # Force winpthread static
)
#Strip debug symbols (Optional - Uncomment if you fixed the syntax error)
add_custom_command(TARGET NppPluginMendixDatadogCopyPasteCleanup POST_BUILD
COMMAND x86_64-w64-mingw32-strip $<TARGET_FILE:NppPluginMendixDatadogCopyPasteCleanup>
)