Skip to content

Commit

Permalink
REMOVE UNNECESSARY COMPILE FLAGS
Browse files Browse the repository at this point in the history
- Remove -DUNICODE.
- Remove -municode.
- Simplify MSVC warning adjustments.
  • Loading branch information
BurningEnlightenment committed Jan 27, 2016
1 parent df36adc commit a41915c
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,13 @@ if (NOT BASE64_INCLUDED)

####################################################################
# platform/compiler specific configuration
if(WIN32)
add_definitions(-DUNICODE)
if(MINGW)
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -municode")
elseif(MSVC)
macro(ADJUST_MSVC_WARNING_LEVEL FLAGS_VAR_NAME)
if(${${FLAGS_VAR_NAME}} MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" ${FLAGS_VAR_NAME} "${${FLAGS_VAR_NAME}}")
else()
set(${FLAGS_VAR_NAME} "${${FLAGS_VAR_NAME}} /W4")
endif()
endmacro()

add_definitions(-D_CRT_SECURE_NO_WARNINGS)
# Force to always compile with W4
ADJUST_MSVC_WARNING_LEVEL(CMAKE_C_FLAGS)
#ADJUST_MSVC_WARNING_LEVEL(CMAKE_CXX_FLAGS)
if(MSVC)
# Force to always compile with W4
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if(${CMAKE_C_FLAGS} MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
endif()
endif()
if (BASE64_GNU_C_COMPATIBLE)
Expand Down

0 comments on commit a41915c

Please sign in to comment.