Skip to content

Fix module compilation flags #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ if(UNIX)

# Makefile
set(MAKEFILE_LDSHARED_FLAGS "-shared")
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
set(MAKEFILE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}")
set(MAKEFILE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}")
if(APPLE)
set(MAKEFILE_LDSHARED_FLAGS "-dynamiclib -headerpad_max_install_names -undefined dynamic_lookup")
endif()
Expand Down
8 changes: 4 additions & 4 deletions cmake/makefile-variables.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ INSTALL_SHARED= ${INSTALL} -m 555
MAKESETUP= $(srcdir)/Modules/makesetup

# Compiler options
OPT= @CMAKE_C_FLAGS@ -DNDEBUG
OPT= @MAKEFILE_C_FLAGS@ -DNDEBUG
BASECFLAGS= -Wno-unused-result -Wsign-compare -Wunreachable-code
CFLAGS= @CMAKE_C_FLAGS@
CFLAGS= @MAKEFILE_C_FLAGS@
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
# be able to build extension modules using the directories specified in the
# environment variables
CPPFLAGS= @CMAKE_CXX_FLAGS@
CPPFLAGS= @MAKEFILE_CXX_FLAGS@
LDFLAGS=
LDLAST=
SGI_ABI=
Expand All @@ -58,7 +58,7 @@ ARFLAGS= rc
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=
# C flags used for building the interpreter object files
PY_CFLAGS= @CMAKE_C_FLAGS@ -DPy_BUILD_CORE
PY_CFLAGS= @MAKEFILE_C_FLAGS@ -DPy_BUILD_CORE


# Machine-dependent subdirectories
Expand Down