diff cinst/CMakeLists.txt @ 1142:148014db2f3b static-libc

(issue126) Commit WIP on static linking libc
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Sep 2014 10:29:38 +0200
parents fc4e1fe4e4d4
children
line wrap: on
line diff
--- a/cinst/CMakeLists.txt	Wed Sep 17 16:23:33 2014 +0200
+++ b/cinst/CMakeLists.txt	Thu Sep 18 10:29:38 2014 +0200
@@ -11,6 +11,8 @@
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common)
 
+set(CMAKE_CXX_FLAGS "${EXTRA_STATIC_FLAGS}")
+
 set(CINST_SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/windowsstore.c
     ${CMAKE_CURRENT_SOURCE_DIR}/nssstore_linux.c
@@ -23,11 +25,20 @@
    set(WIN_EXTRA_LIBS -lcrypt32 -luserenv -lshell32)
 endif(WIN32)
 
+#if(EXISTS "${CMAKE_PREFIX_PATH}/lib/libc.a")
+#   message(status "Linking against static libc: ${CMAKE_PREFIX_PATH}/lib/libc.a")
+#   set (LIBC_STATIC "${CMAKE_PREFIX_PATH}/lib/libc.a" "${CMAKE_PREFIX_PATH}/lib/libpthread.a")
+#endif()
+
+message(fatal "cmake prefix ${CMAKE_PREFIX_PATH}")
 target_link_libraries(cinst
    trustbridge_common
    ${PROFILING_LIBS}
    ${POLARSSL_LIBRARIES}
-   ${WIN_EXTRA_LIBS})
+   ${WIN_EXTRA_LIBS}
+   ${LIBC_STATIC}
+   pthread
+   )
 
 install(TARGETS cinst DESTINATION bin)
 if (WIN32)

http://wald.intevation.org/projects/trustbridge/