Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

MinGW compilation fixes (for 1.x branch) #40

Open
wants to merge 1 commit into from

2 participants

@mbarbon

No description provided.

@bpowers

I've been using this for a couple of weeks, seems to work well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 26, 2011
  1. @mbarbon

    MinGW compilation fixes.

    mbarbon authored
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 4 deletions.
  1. +13 −4 CMakeLists.txt
View
17 CMakeLists.txt
@@ -46,7 +46,11 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
IF (WIN32)
ADD_DEFINITIONS(-DWIN32)
- SET(linkFlags "/PDB:NONE /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
+ IF(CMAKE_COMPILER_IS_GNUCC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+ ELSE(CMAKE_COMPILER_IS_GNUCC)
+ SET(linkFlags "/PDB:NONE /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
+ ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_EXE_LINKER_FLAGS "${linkFlags}"
CACHE STRING "YAJL linker flags" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG ""
@@ -58,9 +62,14 @@ IF (WIN32)
SET(CMAKE_MODULE_LINKER_FLAGS "${linkFlags}"
CACHE STRING "YAJL module linker flags" FORCE)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4255 /wd4130 /wd4100 /wd4711")
- SET(CMAKE_C_FLAGS_DEBUG "/D DEBUG /Od /Z7")
- SET(CMAKE_C_FLAGS_RELEASE "/D NDEBUG /O2")
+ IF(CMAKE_COMPILER_IS_GNUCC)
+ SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -O0 -g")
+ SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2")
+ ELSE(CMAKE_COMPILER_IS_GNUCC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4255 /wd4130 /wd4100 /wd4711")
+ SET(CMAKE_C_FLAGS_DEBUG "/D DEBUG /Od /Z7")
+ SET(CMAKE_C_FLAGS_RELEASE "/D NDEBUG /O2")
+ ENDIF(CMAKE_COMPILER_IS_GNUCC)
ELSE (WIN32)
IF(CMAKE_COMPILER_IS_GNUCC)
INCLUDE(CheckCCompilerFlag)
Something went wrong with that request. Please try again.