Skip to content

Commit

Permalink
probably fix for mingw compile flags #68
Browse files Browse the repository at this point in the history
  • Loading branch information
cgcostume committed Feb 6, 2015
1 parent 42ddff5 commit 6d86573
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions cmake/PlatformWindowsGCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,38 @@ else()
set(EXCEPTION_FLAG "-fno-exceptions")
endif()

set(MINGW_COMPILE_FLAGS "-pthread -pipe -fPIC -Wreturn-type -Wall -Wextra -Wfloat-equal -Wshadow -Wcast-align -Wconversion ${EXCEPTION_FLAG}")
# pthread -> use pthread library
# no-rtti -> disable c++ rtti
# no-exceptions -> disable exception handling
# pipe -> use pipes
# fPIC -> use position independent code
# -Wreturn-type -Werror=return-type -> missing returns in functions and methods are handled as errors which stops the compilation
set(MINGW_COMPILE_FLAGS

${EXCEPTION_FLAG}
-pthread # -> use pthread library
# -no-rtti # -> disable c++ rtti
-pipe # -> use pipes
-Wall # ->
-Wextra # ->
-Werror # ->
-fPIC # -> use position independent code
-Wreturn-type
-Wfloat-equal
-Wcast-align
-Wconversion
# -Werror=return-type -> missing returns in functions and methods are handled as errors which stops the compilation
-Wcast-align # ->
-Wshadow # -> e.g. when a parameter is named like a member, too many warnings, disabled for now
)

set(DEFAULT_COMPILE_FLAGS
${MINGW_COMPILE_FLAGS}
$<$<CONFIG:Debug>:
>
$<$<CONFIG:Release>:
>
)

set(DEFAULT_COMPILE_FLAGS ${MINGW_COMPILE_FLAGS})
set(MINGW_LINKER_FLAGS "-pthread")

set(DEFAULT_LINKER_FLAGS_RELEASE ${MINGW_LINKER_FLAGS})
set(DEFAULT_LINKER_FLAGS_DEBUG ${MINGW_LINKER_FLAGS})
set(DEFAULT_LINKER_FLAGS ${MINGW_LINKER_FLAGS})

# Add platform specific libraries for linking
set(EXTRA_LIBS "")

0 comments on commit 6d86573

Please sign in to comment.