Skip to content

Commit

Permalink
follow-up to c0092c7 - fix macos build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Jul 1, 2023
1 parent c0092c7 commit b54b0d3
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# Project
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(heapusage VERSION 1.0 LANGUAGES C CXX)
set(COMMON_FLAGS "-funwind-tables -g -Wall -Wextra -Wpedantic -Wshadow -Wpointer-arith \
-Wcast-qual -Wno-missing-braces -Wswitch-default -Wcast-align \
-Wunreachable-code -Wuninitialized -Wno-stringop-overflow")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_FLAGS} -Wstrict-prototypes \
-Wmissing-prototypes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")

set(COMMON_FLAGS "-funwind-tables -g -Wall -Wextra -Wpedantic -Wshadow \
-Wpointer-arith -Wcast-qual -Wno-missing-braces \
-Wswitch-default -Wcast-align -Wunreachable-code \
-Wuninitialized")

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(TOOLCHAIN_FLAGS "")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(TOOLCHAIN_FLAGS "-Wno-stringop-overflow")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_FLAGS} ${TOOLCHAIN_FLAGS} \
-Wstrict-prototypes -Wmissing-prototypes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${TOOLCHAIN_FLAGS}")

# C++ compiler flags
set(CMAKE_CXX_STANDARD 11)
Expand Down

0 comments on commit b54b0d3

Please sign in to comment.