Skip to content

Commit

Permalink
[CMAKE] Clear CMAKE_<LANGUAGE>_IMPLICIT_LINK_LIBRARIES and
Browse files Browse the repository at this point in the history
_IMPLICIT_LINK_DIRECTORIES

Othrewise, if you link a RC module with a static C library (as done for
fusion DLLs), you get the standard C libraries from GCC. This is not
what we want.

This might have to be done for MSVC builds. Check build.ninja to verify
this.
  • Loading branch information
zefklop committed Apr 6, 2019
1 parent 157a509 commit f489c3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions overrides-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ foreach(lang C CXX ASM)
set(CMAKE_${lang}_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_${lang}_FLAGS_RELEASE "")
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "")
set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "")
endforeach()
5 changes: 5 additions & 0 deletions sdk/cmake/gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
set(CMAKE_SHARED_MODULE_C_FLAGS "")
set(CMAKE_SHARED_MODULE_CXX_FLAGS "")
set(CMAKE_ASM_FLAGS_DEBUG "")
set(CMAKE_C_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_DEBUG "")
Expand Down Expand Up @@ -105,6 +107,9 @@ endif()
if(DEFINED CMAKE_SHARED_LIBRARY_ASM_FLAGS)
string(REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_ASM_FLAGS ${CMAKE_SHARED_LIBRARY_ASM_FLAGS})
endif()
if(DEFINED CMAKE_SHARED_MODULE_ASM_FLAGS)
string(REPLACE "-fPIC" "" CMAKE_SHARED_MODULE_ASM_FLAGS ${CMAKE_SHARED_MODULE_ASM_FLAGS})
endif()

# Tuning
if(ARCH STREQUAL "i386")
Expand Down

0 comments on commit f489c3f

Please sign in to comment.