[CMAKE] Clear CMAKE_<LANGUAGE>_IMPLICIT_LINK_LIBRARIES and
authorJérôme Gardou <jerome.gardou@reactos.org>
Sat, 6 Apr 2019 14:55:10 +0000 (16:55 +0200)
committerJérôme Gardou <zefklop@users.noreply.github.com>
Sat, 6 Apr 2019 15:43:38 +0000 (17:43 +0200)
_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.

overrides-gcc.cmake
sdk/cmake/gcc.cmake

index d7f7d91..854caf2 100644 (file)
@@ -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()
index 5eee683..8ecc06b 100644 (file)
@@ -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 "")
@@ -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")