Skip to content

[OpenMP][cmake] Simplify -m32 handling #142742

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

Merged
merged 1 commit into from
Jun 5, 2025
Merged
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
20 changes: 10 additions & 10 deletions openmp/runtime/cmake/LibompHandleFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ function(libomp_get_cxxflags cxxflags)
libomp_append(flags_local -Qinline-min-size=1 LIBOMP_HAVE_INLINE_MIN_SIZE_FLAG)
endif()
# Architectural C and C++ flags
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(flags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
libomp_append(flags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
libomp_append(flags_local /arch:SSE2 LIBOMP_HAVE_ARCH_SSE2_FLAG)
libomp_append(flags_local -msse2 LIBOMP_HAVE_MSSE2_FLAG)
libomp_append(flags_local -falign-stack=maintain-16-byte LIBOMP_HAVE_FALIGN_STACK_FLAG)
Expand All @@ -81,10 +81,10 @@ endfunction()
function(libomp_get_asmflags asmflags)
set(asmflags_local)
# Architectural assembler flags
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(asmflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
libomp_append(asmflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
libomp_append(asmflags_local /safeseh LIBOMP_HAVE_SAFESEH_MASM_FLAG)
libomp_append(asmflags_local /coff LIBOMP_HAVE_COFF_MASM_FLAG)
elseif(${MIC})
Expand Down Expand Up @@ -112,10 +112,10 @@ function(libomp_get_ldflags ldflags)
libomp_append(ldflags_local -static-intel LIBOMP_HAVE_STATIC_INTEL_FLAG)
libomp_append(ldflags_local /SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
# Architectural linker flags
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(ldflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
libomp_append(ldflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
libomp_append(ldflags_local -msse2 LIBOMP_HAVE_MSSE2_FLAG)
elseif(${MIC})
libomp_append(ldflags_local -mmic LIBOMP_HAVE_MMIC_FLAG)
Expand Down Expand Up @@ -162,7 +162,7 @@ endfunction()
# Fortran flags
function(libomp_get_fflags fflags)
set(fflags_local)
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(fflags_local -m32 LIBOMP_HAVE_M32_FORTRAN_FLAG)
endif()
set(fflags_local ${fflags_local} ${LIBOMP_FFLAGS})
Expand Down
Loading