Old Linux cmake: apply WIN32_LEAN_AND_MEAN to all feature checks #6765 Sign in to view logs Summary Jobs linux (cmake & autoconf) Run details Usage Workflow file Triggered via push October 11, 2024 15:57 vszakats pushed dfd36d3 master Status Success Total duration 5m 6s Artifacts ...
if (WIN32) target_compile_definitions(my_lib PRIVATE # Prevents Windows.h from adding unnecessary includes WIN32_LEAN_AND_MEAN # Prevents Windows.h from defining min/max as macros NOMINMAX ) endif() 2.) add_compile_definitions 版本3.12 中的新功能。 在此处查找有关用于编译器标志的命令的更多...
file(APPEND gtest.patch " set(cxx_base_flags \"\${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32\")\n") file(APPEND gtest.patch " set(cxx_base_flags \"\${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN\")\n") file(APPEND gtest.patch " set(cxx_exception_flags \"...
add_definitions(-DWIN32_LEAN_AND_MEAN) ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "GNU") #MinGW compiler ENDIF (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux") #or #set(CMAKE_POSITION_INDEPENDENT_CODE ON)2...
32 33 34 35 CMAKE_MINIMUM_REQUIRED(VERSION 3.8) PROJECT(Test C CXX) ### # Compiler and linker options ADD_DEFINITIONS(-Wall -DWIN32_LEAN_AND_MEAN) SET(CMAKE_AUTOMOC ON) SET(CMAKE_AUTORCC ON) SET(CMAKE_CXX_STANDARD 11) FILE(GLOB SOURCE_FILES"${CMAKE_CURRENT...
IF(WIN32)ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE-DWIN32_LEAN_AND_MEAN-MD)ELSEIF(${CMAKE_SYSTEM_NAME}STREQUAL"Darwin")ADD_DEFINITIONS(-DOSX)ENDIF() -MD是什么鬼?应该就是它强制将项目的代码生成方式设置成了/MD,删除它,再试果然正常了。
IF(WIN32) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD) ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") ADD_DEFINITIONS(-DOSX) ENDIF() 1. 2. 3. 4. 5. 6. 7. 8. 9. 2:时间版本 备注:与cmake版本有关(低版本不支持,比如2.8.7 ,应该2.8.11以上,没验证) ...
# Compiler and linker optionsADD_DEFINITIONS(-Wall-DWIN32_LEAN_AND_MEAN)SET(CMAKE_AUTOMOCON)SET(CMAKE_AUTORCCON)SET(CMAKE_CXX_STANDARD11)FILE(GLOBSOURCE_FILES"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")FILE(GLOBHEADER_FILES"${CMAKE_CURRENT_SOURCE_DIR}/*.h")FILE(GLOBFORMS"${CMAKE_CURRENT_SOU...
if(WIN32) list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602 _CRT_DECLARE_NONSTDC_NAMES=0) list(APPEND uv_libraries psapi user32 advapi32 iphlpapi userenv ws2_32 dbghelp ole32 shell32) list(APPEND uv_sources src/win/async.c src/win/core.c src/win/...
add_definitions(-DWIN32_LEAN_AND_MEAN) add_definitions(-DNOMINMAX) # Allow use of fopen. add_definitions(-D_CRT_SECURE_NO_WARNINGS) # VS 2017 and higher supports STL-only warning suppressions. # A bug in CMake < 3.13.0 may cause the space in this value to # cause issues whe...