Changeset: 3620e8e04d7a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3620e8e04d7a
Modified Files:
CMakeLists.txt
Branch: cmake-fun
Log Message:
Added missing linker options that will hopefully fix Mac OS and FreeBSD
compilations.
diffs (57 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -504,12 +504,12 @@ if(NOT ${WITH_READLINE} STREQUAL "NO")
elseif(${WITH_READLINE} STREQUAL "YES")
message(FATAL_ERROR "readline/readline.h does
not contain rl_completion_func_t, is it GNU readline?")
else()
- message(WARNING "readline/readline.h does not
contain rl_completion_func_t, is it GNU readline?")
+ message(STATUS "readline/readline.h does not
contain rl_completion_func_t, is it GNU readline?")
endif()
elseif(${WITH_READLINE} STREQUAL "YES")
message(FATAL_ERROR "Readline library does not contain
rl_completion_matches")
else()
- message(WARNING "Readline library does not contain
rl_completion_matches")
+ message(STATUS "Readline library does not contain
rl_completion_matches")
endif()
endif()
cmake_pop_check_state()
@@ -1153,16 +1153,6 @@ endif()
# Very Important, check for compiler flags after all libraries checks,
otherwise extra compiler flags might break the
# library tests
-if(NOT "${LINK_OPTIONS}" MATCHES "-Wl,-Bsymbolic-functions")
- set(PREV_LINK_OPTIONS "${LINK_OPTIONS}")
- set(LINK_OPTIONS "${LINK_OPTIONS} -Wl,-Bsymbolic-functions")
- check_c_source_compiles("int main(int argc,char**
argv){(void)argc;(void)argv;return 0;}" HAVE_WL_BSYMBOLIC_FUNCTIONS)
- if(NOT HAVE_WL_BSYMBOLIC_FUNCTIONS)
- set(LINK_OPTIONS "${PREV_LINK_OPTIONS}")
- endif()
-endif()
-
-# Check for compiler flags
function(MT_removeCompilerFlag REGEX_EXPRESSION FLAG_TO_REMOVE OLD_FLAGS BUILD
NEW_FLAGS)
if(${OLD_FLAGS} MATCHES "${REGEX_EXPRESSION}")
string(REGEX REPLACE "${REGEX_EXPRESSION}" "" NEW_VAR
"${OLD_FLAGS}")
@@ -1244,6 +1234,10 @@ else() #GCC, clang and Apple clang
if(${ENABLE_ASSERT} STREQUAL "NO")
MT_addCompilerFlag("-fomit-frame-pointer"
"-fomit-frame-pointer" "${CMAKE_C_FLAGS}" "All" CMAKE_C_FLAGS)
endif()
+
+ # Linker flags
+ MT_addCompilerFlag("-Wl,-Bsymbolic-functions"
"-Wl,-Bsymbolic-functions" "${LINK_OPTIONS}" "All" LINK_OPTIONS)
+ MT_addCompilerFlag("-Wl,-undefined,dynamic_lookup"
"-Wl,-undefined,dynamic_lookup" "${LINK_OPTIONS}" "All" LINK_OPTIONS)
endif()
function(MT_checkCompilerFlag Flag)
@@ -1299,9 +1293,7 @@ if(${ENABLE_STRICT} STREQUAL "YES")
MT_checkCompilerFlag("-Wno-char-subscripts")
MT_checkCompilerFlag("-Wunreachable-code")
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "Intel" AND ${CMAKE_SYSTEM_NAME}
STREQUAL "Linux")
- if(NOT "${LINK_OPTIONS}" MATCHES "-shared-intel")
- set(LINK_OPTIONS "${LINK_OPTIONS} -shared-intel")
- endif()
+ MT_addCompilerFlag("-shared-intel" "-shared-intel"
"${LINK_OPTIONS}" "All" LINK_OPTIONS)
MT_checkCompilerFlag("-ansi")
MT_checkCompilerFlag("-Wall")
MT_checkCompilerFlag("-w2")
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list