diff options
author | Sadie Powell <sadie@witchery.services> | 2022-01-13 02:30:36 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2022-01-13 02:35:23 +0000 |
commit | 2881ba112b7b4ef084172f4de501211032ee9f91 (patch) | |
tree | d1272b1ece2ce0756b4f6228fedc01889b096b0c /CMakeLists.txt | |
parent | 1ee81580c63b4548935687f93e074905b26abddc (diff) |
Clean up the predefined variables on Windows.
- Use _MSC_VER for detecting MSVC instead of a custom define.
- Remove MINGW as you can use __MINGW32__ to detect this.
- Stop defining _WIN32 as this will always be defined on Windows.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 486851dbc..0ab961d82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,10 +176,8 @@ if(REPRODUCIBLE_BUILD) add_definitions(-DREPRODUCIBLE_BUILD) endif() -# If using Windows, always add the _WIN32 define if(WIN32) - add_definitions(-D_WIN32) - # And include the windows specific folder for our anope_windows.h + # If using Windows, include the windows specific folder for anope_windows.h include_directories(${Anope_SOURCE_DIR}/src/win32) endif() @@ -191,15 +189,11 @@ if(MSVC) string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4355 /wd4706 /wd4800 /wd4996 /EHs") - add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Otherwise, we're not using Visual Studio else() # Set the compile flags to have all warnings on (including shadowed variables) set(CXXFLAGS "${CXXFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wpedantic -Wno-unused-parameter ${CMAKE_CXX_FLAGS}") - # Also, if we are building under MinGW, add another define for MinGW - if(MINGW) - add_definitions(-DMINGW) - endif() endif() # If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags |