2019-07-22 01:39:56 +02:00
|
|
|
if(NOT WIN32)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2019-04-30 01:48:43 +02:00
|
|
|
enable_language(RC)
|
|
|
|
|
2019-07-21 18:05:51 +02:00
|
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
2019-07-29 01:31:07 +02:00
|
|
|
|
|
|
|
if(NOT MSVC_VERSION)
|
2019-05-06 04:33:19 +02:00
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
|
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>)
|
2021-03-02 01:04:05 +01:00
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fpermissive>)
|
2019-05-06 04:33:19 +02:00
|
|
|
# unlike unix where you get a *single* compiler ID string in .comment
|
|
|
|
# GNU ld sees fit to merge *all* the .ident sections in object files
|
|
|
|
# to .r[o]data section one after the other!
|
2019-07-29 01:31:07 +02:00
|
|
|
add_compile_options(-fno-ident -Wa,-mbig-obj)
|
2021-06-08 14:32:01 +02:00
|
|
|
link_libraries( -lws2_32 -lshlwapi -ldbghelp -luser32 -liphlpapi -lpsapi -luserenv)
|
2020-06-24 16:17:43 +02:00
|
|
|
# zmq requires windows xp or higher
|
2020-09-16 21:47:35 +02:00
|
|
|
add_definitions(-DWINVER=0x0501 -D_WIN32_WINNT=0x0501)
|
2019-05-06 04:33:19 +02:00
|
|
|
endif()
|
2019-10-07 01:23:30 +02:00
|
|
|
|
|
|
|
if(EMBEDDED_CFG)
|
|
|
|
link_libatomic()
|
2019-08-29 15:59:04 +02:00
|
|
|
endif()
|
2019-10-07 01:23:30 +02:00
|
|
|
|
2020-02-26 03:47:50 +01:00
|
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN -DWIN32)
|
2019-04-30 01:48:43 +02:00
|
|
|
|
2020-05-17 21:41:48 +02:00
|
|
|
if (NOT STATIC_LINK AND NOT MSVC)
|
2019-04-30 01:48:43 +02:00
|
|
|
message("must ship compiler runtime libraries with this build: libwinpthread-1.dll, libgcc_s_dw2-1.dll, and libstdc++-6.dll")
|
2020-05-17 21:41:48 +02:00
|
|
|
message("for release builds, turn on STATIC_LINK in cmake options")
|
2019-07-17 21:35:49 +02:00
|
|
|
endif()
|