libssp is needed only for mingw
[novacoin.git] / CMakeLists.txt
index 2e2df11..09aa47c 100644 (file)
@@ -51,11 +51,15 @@ set(CMAKE_CXX_FLAGS "/O2 /GR /EHsc")
 endif()
 
 set(Boost_USE_STATIC_LIBS   ON)
+if(WIN32)
 set(Boost_USE_STATIC_RUNTIME ON)
+endif()
 find_package(Boost REQUIRED COMPONENTS atomic chrono filesystem program_options system thread)
 set(OPENSSL_USE_STATIC_LIBS ON)
 find_package(OpenSSL REQUIRED)
 
+# Disable compiling qrencode executables
+option(WITH_TOOLS "Build utility tools"  NO)
 add_subdirectory(src/additional/libqrencode)
 add_subdirectory(src/additional/IXWebSocket)
 
@@ -257,14 +261,13 @@ execute_process (
 )
 list(APPEND ALL_DEFINITIONS HAVE_BUILD_INFO)
 
-add_executable(novacoin-qt ${ALL_SOURCES})
+add_executable(novacoin-qt WIN32 ${ALL_SOURCES})
 
 if (NOT MSVC)
-list(APPEND ALL_LIBRARIES ssp)
 list(APPEND ALL_DEFINITIONS _FORTIFY_SOURCE=2)
 if (WIN32)
-list(APPEND ALL_LIBRARIES mingw32)
-set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static")
+list(APPEND ALL_LIBRARIES mingw32 ssp)
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static")
 endif()
 endif()