2019-07-21 23:39:56 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2019-04-29 23:48:43 +00:00
|
|
|
enable_language(RC)
|
|
|
|
|
2019-07-21 16:05:51 +00:00
|
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
2019-07-28 23:31:07 +00:00
|
|
|
|
|
|
|
if(NOT MSVC_VERSION)
|
2019-05-06 02:33:19 +00:00
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
|
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>)
|
2021-03-02 00:04:05 +00:00
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fpermissive>)
|
2019-05-06 02:33:19 +00: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-28 23:31:07 +00:00
|
|
|
add_compile_options(-fno-ident -Wa,-mbig-obj)
|
2021-06-08 12:32:01 +00:00
|
|
|
link_libraries( -lws2_32 -lshlwapi -ldbghelp -luser32 -liphlpapi -lpsapi -luserenv)
|
2021-12-07 16:17:20 +00:00
|
|
|
# the minimum windows version, set to 6 rn because supporting older windows is hell
|
|
|
|
set(_winver 0x0600)
|
|
|
|
add_definitions(-DWINVER=${_winver} -D_WIN32_WINNT=${_winver})
|
2019-05-06 02:33:19 +00:00
|
|
|
endif()
|
2019-10-06 23:23:30 +00:00
|
|
|
|
|
|
|
if(EMBEDDED_CFG)
|
|
|
|
link_libatomic()
|
2019-08-29 13:59:04 +00:00
|
|
|
endif()
|
2019-10-06 23:23:30 +00:00
|
|
|
|
2020-02-26 02:47:50 +00:00
|
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN -DWIN32)
|
2019-04-29 23:48:43 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if (NOT STATIC_LINK AND NOT MSVC)
|
2019-04-29 23:48:43 +00: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 19:41:48 +00:00
|
|
|
message("for release builds, turn on STATIC_LINK in cmake options")
|
2019-07-17 19:35:49 +00:00
|
|
|
endif()
|