From 090f542d49be3891e03b42ceff8df3648336ead0 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 6 Aug 2015 13:33:53 -0400 Subject: [PATCH] Allow for per-plugin compile flags --- plugins/Plugins.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/Plugins.cmake b/plugins/Plugins.cmake index 1e8ef8936..c801570db 100644 --- a/plugins/Plugins.cmake +++ b/plugins/Plugins.cmake @@ -59,7 +59,7 @@ ENDMACRO() MACRO(DFHACK_PLUGIN) PARSE_ARGUMENTS(PLUGIN - "LINK_LIBRARIES;DEPENDS;PROTOBUFS" + "LINK_LIBRARIES;DEPENDS;PROTOBUFS;COMPILE_FLAGS;COMPILE_FLAGS_GCC;COMPILE_FLAGS_MSVC" "SOME_OPT" ${ARGN} ) @@ -95,6 +95,13 @@ MACRO(DFHACK_PLUGIN) TARGET_LINK_LIBRARIES(${PLUGIN_NAME} dfhack dfhack-version ${PLUGIN_LINK_LIBRARIES}) ENDIF() + SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES COMPILE_FLAGS "${PLUGIN_COMPILE_FLAGS}") + IF(UNIX) + SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES COMPILE_FLAGS "${PLUGIN_COMPILE_FLAGS_GCC}") + ELSE() + SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES COMPILE_FLAGS "${PLUGIN_COMPILE_FLAGS_MSVC}") + ENDIF() + IF(APPLE) SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES SUFFIX .plug.dylib PREFIX "") ELSEIF(UNIX)