Skip to content

Commit

Permalink
Configuration - MinGW Clang build support #144
Browse files Browse the repository at this point in the history
Clang with GNU needs the same compiler flags as for GCC.
Refactor compiler flag to be more flexible.
  • Loading branch information
dpasukhi committed Nov 3, 2024
1 parent 3ec8891 commit e09563c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions adm/cmake/occt_defs_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,15 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
elseif(MINGW)
endif()
if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
#set (CMAKE_SYSTEM_VERSION "6.1")
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")

# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
endif()
if (DEFINED CMAKE_COMPILER_IS_GNUCXX)
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
Expand Down

0 comments on commit e09563c

Please sign in to comment.