Retain old CMAKE_CXX_FLAGS while adding visibility stuff.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Sun, 10 Nov 2013 04:17:57 +0000 (12:17 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Sun, 10 Nov 2013 04:17:57 +0000 (12:17 +0800)
Add -Wl,-no-undefined -Wall flags to ensure correctness.

CMakeLists.txt

index e268eb5..0cb109e 100644 (file)
@@ -170,7 +170,7 @@ set(APP_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/liblxqt)
 # use gcc visibility feature to decrease unnecessary exported symbols
 if (CMAKE_COMPILER_IS_GNUCXX)
   # set visibility to hidden to hide symbols, unlesss they're exporeted manually in the code
-  set(CMAKE_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wl,-no-undefined -Wall")
 endif()
 add_definitions(-DCOMPILE_LIBLXQT)