Skip to content

Commit

Permalink
Refactor shared cmake flags into a CMAKE_COMMON
Browse files Browse the repository at this point in the history
add -DCMAKE_VERBOSE_MAKEFILE=ON keying off our VERBOSE flag
  • Loading branch information
tkelman committed Nov 9, 2014
1 parent ec9051e commit faf6990
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ endif
endif
CONFIGURE_COMMON += F77="$(FC)" CC="$(CC)" CXX="$(CXX)"

# prepare CMAKE_CC and CMAKE_CXX flags
CMAKE_CC = -DCMAKE_C_COMPILER="$(CC_BASE)"
CMAKE_COMMON = -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DCMAKE_BUILD_TYPE=Release
ifneq ($(VERBOSE), 0)
CMAKE_COMMON += -DCMAKE_VERBOSE_MAKEFILE=ON
endif
CMAKE_COMMON += -DCMAKE_C_COMPILER="$(CC_BASE)"
ifdef CC_ARG
CMAKE_CC += -DCMAKE_C_COMPILER_ARG1="$(CC_ARG)"
CMAKE_COMMON += -DCMAKE_C_COMPILER_ARG1="$(CC_ARG)"
endif
CMAKE_CXX = -DCMAKE_CXX_COMPILER="$(CXX_BASE)"
CMAKE_COMMON += -DCMAKE_CXX_COMPILER="$(CXX_BASE)"
ifdef CXX_ARG
CMAKE_CXX += -DCMAKE_CXX_COMPILER_ARG1="$(CXX_ARG)"
CMAKE_COMMON += -DCMAKE_CXX_COMPILER_ARG1="$(CXX_ARG)"
endif

# If the top-level Makefile is called with environment variables,
Expand Down Expand Up @@ -373,12 +376,12 @@ libcxx-build:
mkdir -p libcxx-build
libcxx-build/Makefile: llvm-$(LLVM_VER)/projects/libcxx | llvm-$(LLVM_VER)/projects/libcxxabi libcxx-build
cd libcxx-build && \
$(CMAKE) -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_LIBCXXABI_INCLUDE_PATHS="../llvm-$(LLVM_VER)/projects/libcxxabi/include" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(build_prefix) ../llvm-$(LLVM_VER)/projects/libcxx $(CMAKE_CC) $(CMAKE_CXX) -DCMAKE_SHARED_LINKER_FLAGS="-L$(build_libdir) -Bstatic -lirc -Bdynamic" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)"
$(CMAKE) -G "Unix Makefiles" $(CMAKE_COMMON) -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_LIBCXXABI_INCLUDE_PATHS="../llvm-$(LLVM_VER)/projects/libcxxabi/include" ../llvm-$(LLVM_VER)/projects/libcxx -DCMAKE_SHARED_LINKER_FLAGS="-L$(build_libdir) -Bstatic -lirc -Bdynamic" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)"
libcxxabi-build:
mkdir -p libcxxabi-build
libcxxabi-build/Makefile: llvm-$(LLVM_VER)/projects/libcxxabi | libcxxabi-build
cd libcxxabi-build && \
$(CMAKE) -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DLLVM_MAIN_SRC_DIR=../llvm-svn -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(build_prefix) ../llvm-$(LLVM_VER)/projects/libcxxabi $(CMAKE_CC) $(CMAKE_CXX) -DLIBCXXABI_CXX_ABI_LIBRARIES="-Bstatic -lirc -Bdynamic" -DCMAKE_CXX_FLAGS="$(CXXFLAGS) -std=c++11"
$(CMAKE) -G "Unix Makefiles" $(CMAKE_COMMON) -DLLVM_MAIN_SRC_DIR=../llvm-svn ../llvm-$(LLVM_VER)/projects/libcxxabi -DLIBCXXABI_CXX_ABI_LIBRARIES="-Bstatic -lirc -Bdynamic" -DCMAKE_CXX_FLAGS="$(CXXFLAGS) -std=c++11"
llvm-$(LLVM_VER)/projects/libcxxabi/lib/libc++abi.so.1.0: llvm-$(LLVM_VER)/projects/libcxxabi | llvm-$(LLVM_VER)/projects/libcxx
libcxxabi-build/libc++abi.so.1.0: | libcxxabi-build/Makefile
cd libcxxabi-build && $(MAKE)
Expand Down Expand Up @@ -1748,7 +1751,7 @@ install-virtualenv: $(VIRTUALENV_TARGET)
LIBGIT2_OBJ_SOURCE = libgit2-$(LIBGIT2_VER)/build/libgit2.$(SHLIB_EXT)
LIBGIT2_OBJ_TARGET = $(build_shlibdir)/libgit2.$(SHLIB_EXT)

LIBGIT2_OPTS = -DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release $(CMAKE_CC)
LIBGIT2_OPTS = $(CMAKE_COMMON) -DTHREADSAFE=ON
ifeq ($(OS),WINNT)
LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF -DCMAKE_SYSTEM_NAME=Windows
ifeq ($(BUILD_OS),WINNT)
Expand Down

4 comments on commit faf6990

@tkelman
Copy link
Contributor Author

@tkelman tkelman commented on faf6990 Nov 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @maleadt slight DRY cleanup

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this seems like a better fit for these options.
I was going to propose adding the libcxx ones to LIBCXX_OPTIONS instead (cfr. LIBGIT2_OPTS), but it seems like that variable isn't used?

@tkelman
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @Keno wants to, or doesn't object

@Keno
Copy link
Member

@Keno Keno commented on faf6990 Nov 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it. I'll fix it later if anything breaks.

Please sign in to comment.