X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=b49de36f7525b30d2e4bdf984cb10f600733a522;hb=bc6abecf0522c9944d8145218bb0636766126da0;hp=a4a266bdfbcff527e37567f0bd9497d827117fa4;hpb=41a8c43a751fc85b4053976a998a496260fd8e8b;p=novacoin.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a4a266b..b49de36 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,11 +25,21 @@ if(CCACHE_FOUND) set(CMAKE_CXX_COMPILER_LAUNCHER ccache) endif(CCACHE_FOUND) -set (CMAKE_C_FLAGS "-flto -O3 -fPIC -Wno-deprecated -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2") -set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fexceptions -frtti") +if (NOT MSVC) +if (NOT WIN32) +set(FPIC "-fPIC") +endif() +set (CMAKE_C_FLAGS "-flto -O3 ${FPIC} -Wno-deprecated -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2") +set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -fexceptions -frtti") +else() +set(CMAKE_C_FLAGS "/O2") +set(CMAKE_CXX_FLAGS "/O2 /GR /EHsc") +endif() + set(CMAKE_CXX_EXTENSIONS OFF) set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_RUNTIME ON) find_package(Boost REQUIRED COMPONENTS atomic chrono filesystem program_options system thread) set(OPENSSL_USE_STATIC_LIBS ON) find_package(OpenSSL REQUIRED) @@ -106,7 +116,8 @@ list(APPEND ALL_LIBRARIES ${Boost_LIBRARIES} ixwebsocket OpenSSL::Crypto) # Windows-specific libraries if (WIN32) - list(APPEND ALL_LIBRARIES kernel32 user32 gdi32 comdlg32 winspool winmm shell32 comctl32 ole32 oleaut32 uuid rpcrt4 advapi32 ws2_32 mswsock shlwapi) + list(APPEND ALL_LIBRARIES kernel32 user32 gdi32 comdlg32 winspool winmm shell32 comctl32 ole32 oleaut32 uuid rpcrt4 advapi32 ws2_32 mswsock shlwapi pthread) + list(APPEND ALL_DEFINITIONS WIN32) endif() # Some systems need rt library