Skip to content
Snippets Groups Projects
Commit 6e57c44b authored by Pavel Cherenkov's avatar Pavel Cherenkov
Browse files

Merge branch 'macosx-clang'

parents a3eae7bb b2d9df6e
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ endif() ...@@ -45,6 +45,7 @@ endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang) if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_COMPILER_IS_CLANG true) set(CMAKE_COMPILER_IS_CLANG true)
set(CMAKE_COMPILER_IS_GNUCC false)
endif() endif()
if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCC)
...@@ -90,7 +91,8 @@ endif() ...@@ -90,7 +91,8 @@ endif()
if (TARGET_OS_DARWIN) if (TARGET_OS_DARWIN)
# Mac ports get installed into /opt/local, hence: # Mac ports get installed into /opt/local, hence:
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} /opt/local/include") set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} /opt/local/include")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/local/include -L/opt/local/lib") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/local/include")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/opt/local/lib")
endif() endif()
check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANON) check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANON)
...@@ -143,8 +145,14 @@ endif() ...@@ -143,8 +145,14 @@ endif()
# #
# Perform build type specific configuration. # Perform build type specific configuration.
# #
set (CMAKE_C_FLAGS_DEBUG "-ggdb -O0 -fexceptions -funwind-tables") if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS_RELWITHDEBUGINFO "-ggdb -O2 -fexceptions -funwind-tables -DNDEBUG -DNVALGRIND") set (CC_DEBUG_OPT "-ggdb")
else()
set (CC_DEBUG_OPT "-g")
endif()
set (CMAKE_C_FLAGS_DEBUG "${CC_DEBUG_OPT} -O0 -fexceptions -funwind-tables")
set (CMAKE_C_FLAGS_RELWITHDEBUGINFO "${CC_DEBUG_OPT} -O2 -fexceptions -funwind-tables -DNDEBUG -DNVALGRIND")
set (CMAKE_C_FLAGS_RELEASE "-DNDEBUG -DNVALGRIND") set (CMAKE_C_FLAGS_RELEASE "-DNDEBUG -DNVALGRIND")
# #
...@@ -297,7 +305,9 @@ if (TARGET_OS_DARWIN) ...@@ -297,7 +305,9 @@ if (TARGET_OS_DARWIN)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fgnu-runtime") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fgnu-runtime")
endif() endif()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
endif()
add_subdirectory(third_party) add_subdirectory(third_party)
add_subdirectory(cfg) add_subdirectory(cfg)
......
...@@ -220,8 +220,10 @@ TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAG ...@@ -220,8 +220,10 @@ TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAG
TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS) TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS)
TARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS) TARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS)
ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs))) ifneq (,$(findstring gcc,$(TARGET_CC)))
TARGET_XCFLAGS+= -fno-stack-protector ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs)))
TARGET_XCFLAGS+= -fno-stack-protector
endif
endif endif
TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM) TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment