Skip to content

Commit

Permalink
Simpler c/cxx flags
Browse files Browse the repository at this point in the history
  • Loading branch information
bdejong committed Dec 7, 2016
1 parent 0b65b7d commit 5e83943
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
6 changes: 0 additions & 6 deletions Common/c_flag_overrides.cmake

This file was deleted.

14 changes: 10 additions & 4 deletions Common/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ function(pre_build)
if (APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" PARENT_SCOPE)
set(CMAKE_OSX_ARCHITECTURES "i386" "x86_64" PARENT_SCOPE)
elseif(MSVC)
# static linking
foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
if(${flag_var} MATCHES "/MDd")
string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
endif()
endforeach()
endif()

set(COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Common)
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${COMMON_DIR}/c_flag_overrides.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${COMMON_DIR}/cxx_flag_overrides.cmake)
endfunction(pre_build)

#*******************************************************************************
Expand Down
6 changes: 0 additions & 6 deletions Common/cxx_flag_overrides.cmake

This file was deleted.

0 comments on commit 5e83943

Please sign in to comment.