aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/modules/perlcore/CMakeLists.txt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/perlcore/CMakeLists.txt b/src/modules/perlcore/CMakeLists.txt
index e0b5de248..56403fa8a 100644
--- a/src/modules/perlcore/CMakeLists.txt
+++ b/src/modules/perlcore/CMakeLists.txt
@@ -11,6 +11,8 @@ if(COMPILE_PERL_SUPPORT)
# Activestates perl is too chatty for us
set( ENV{ACTIVEPERL_CONFIG_SILENT} 1 )
endif()
+
+ # Get compile flags
execute_process(COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ccopts
OUTPUT_VARIABLE PERL_COMPILE_FLAGS
)
@@ -20,7 +22,7 @@ if(COMPILE_PERL_SUPPORT)
#remove leading and trailing spaces (string strip)
string(REGEX REPLACE "(^( )+|( )+$)" "" PERL_COMPILE_FLAGS ${PERL_COMPILE_FLAGS})
- # Get the right flags to link with
+ # Get links flags
execute_process(
COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ldopts
OUTPUT_VARIABLE PERL_LINK_FLAGS
@@ -30,7 +32,6 @@ if(COMPILE_PERL_SUPPORT)
string(REGEX REPLACE "(\r?\n)+$" "" PERL_LINK_FLAGS "${PERL_LINK_FLAGS}")
# Remove leading and trailing spaces (string strip)
string(REGEX REPLACE "(^( )+|( )+$)" "" PERL_LINK_FLAGS "${PERL_LINK_FLAGS}")
-
endif()
include(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
@@ -44,5 +45,6 @@ if(COMPILE_PERL_SUPPORT)
string(REPLACE "/RTC1" "" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
endif()
set_target_properties(${kvi_module_name} PROPERTIES COMPILE_FLAGS ${PERL_COMPILE_FLAGS})
- set_target_properties(${kvi_module_name} PROPERTIES LINK_FLAGS "${MODULE_ADDITIONAL_LINK_FLAGS} ${PERL_LINK_FLAGS}")
+ set_target_properties(${kvi_module_name} PROPERTIES LINK_FLAGS "${MODULE_ADDITIONAL_LINK_FLAGS}")
+ target_link_libraries(${kvi_module_name} ${LIBS} "${PERL_LINK_FLAGS}")
endif()