From 316a7467b094cde63c21e73f3178b5e30e803587 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 1 Jun 2011 22:18:48 +0000 Subject: [PATCH] [CMAKE] Merge r52051 and r52052 from cmake branch: * Improve static libs creation in *nix. Dedicated to arty. * Add a missing dependency. svn path=/trunk/; revision=52053 --- reactos/boot/freeldr/freeldr/CMakeLists.txt | 1 + reactos/gcc.cmake | 4 ---- reactos/toolchain-mingw32.cmake | 7 +++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index f5f362519c6..a231c69e032 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -154,6 +154,7 @@ endif() set_source_files_properties(${FREELDR_ARCH_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_") add_library(freeldr_arch ${FREELDR_ARCH_SOURCE}) +add_dependencies(freeldr_arch bugcodes) list(APPEND FREELDR_SOURCE bootmgr.c diff --git a/reactos/gcc.cmake b/reactos/gcc.cmake index a51cf6523cd..cce35da157d 100644 --- a/reactos/gcc.cmake +++ b/reactos/gcc.cmake @@ -19,10 +19,6 @@ set(CMAKE_RC_COMPILE_OBJECT "${WRC} -i -o " " -i -J res -O coff -o ") -if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - set(CMAKE_C_CREATE_STATIC_LIBRARY " crs ") -endif() - # Compiler Core add_definitions(-pipe -fms-extensions) diff --git a/reactos/toolchain-mingw32.cmake b/reactos/toolchain-mingw32.cmake index e50a63d0424..8cb6952fbca 100644 --- a/reactos/toolchain-mingw32.cmake +++ b/reactos/toolchain-mingw32.cmake @@ -35,6 +35,13 @@ set(CMAKE_RC_COMPILER ${MINGW_PREFIX}windres) set(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc) set(CMAKE_ASM_COMPILE_OBJECT " -x assembler-with-cpp -o -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ") +set(CMAKE_AR ${MINGW_PREFIX}ar) +if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + set(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_AR} crs ") + set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) + set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) +endif() + # Use stdcall fixups, and don't link with anything by default unless we say so set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C Libraries")