Author: jgardou Date: Sat Sep 3 23:05:09 2011 New Revision: 53567
URL: http://svn.reactos.org/svn/reactos?rev=53567&view=rev Log: [CMAKE] - add flags to ASM as well instead of hacking the compile rule - remove -fPIC flag from ASM compile flags, (it's a cmake bug) - enable languages before including compiler specific files.
Modified: trunk/reactos/CMakeLists.txt trunk/reactos/cmake/compilerflags.cmake trunk/reactos/cmake/gcc.cmake
Modified: trunk/reactos/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=53567&am... ============================================================================== --- trunk/reactos/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/CMakeLists.txt [iso-8859-1] Sat Sep 3 23:05:09 2011 @@ -137,6 +137,12 @@ elseif(ARCH MATCHES arm) add_definitions(-DUSE_COMPILER_EXCEPTIONS) endif() + + # Activate support for assembly source files + enable_language(ASM) + + # Activate language support for resource files + enable_language(RC)
# Compiler specific definitions and macros if(MSVC) @@ -150,12 +156,6 @@
# IDL macros for widl/midl include(cmake/idl-support.cmake) - - # Activate support for assembly source files - enable_language(ASM) - - # Activate language support for resource files - enable_language(RC)
if(MSVC AND USE_WDK_HEADERS) include_directories(
Modified: trunk/reactos/cmake/compilerflags.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/compilerflags.cmake?r... ============================================================================== --- trunk/reactos/cmake/compilerflags.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/compilerflags.cmake [iso-8859-1] Sat Sep 3 23:05:09 2011 @@ -43,6 +43,7 @@ # Adds the compiler flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE) + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${_flags}" PARENT_SCOPE) endfunction()
function(add_target_compile_flags _module _flags)
Modified: trunk/reactos/cmake/gcc.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=53567&a... ============================================================================== --- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Sat Sep 3 23:05:09 2011 @@ -4,6 +4,9 @@
# Debugging (Note: DWARF-4 on 4.5.1 when we ship) add_compile_flags("-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unused-debug-types") + +# For some reason, cmake sets -fPIC, and we don't want it +string(REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_ASM_FLAGS ${CMAKE_SHARED_LIBRARY_ASM_FLAGS})
# Tuning if(ARCH MATCHES i386) @@ -13,7 +16,7 @@ endif()
# Warnings -add_compile_flags("-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value -Winvalid-pch") +add_compile_flags("-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value")
if(ARCH MATCHES amd64) add_compile_flags("-Wno-format") @@ -86,7 +89,7 @@ set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm <FLAGS> ${CMAKE_C_FLAGS} <DEFINES> -D__ASM__ -c <SOURCE>") +set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
#set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> <CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -O coff -o <OBJECT>")
@@ -295,12 +298,7 @@ IMPLICIT_DEPENDS ${__lang} ${_header_filename} DEPENDS ${_header_filename} ${ARGN}) get_target_property(_src_files ${_target_name} SOURCES) - foreach(_item in ${_src_files}) - get_source_file_property(__src_lang ${_item} LANGUAGE) - if(__src_lang STREQUAL __lang) - set_source_files_properties(${_item} PROPERTIES COMPILE_FLAGS "-fpch-preprocess" OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_gch_filename}) - endif() - endforeach() + add_target_compile_flags(${_target_name} "-fpch-preprocess -Winvalid-pch -Wno-error=invalid-pch") #set dependency checking : depends on precompiled header only which already depends on deeper header set_target_properties(${_target_name} PROPERTIES IMPLICIT_DEPENDS_INCLUDE_TRANSFORM ""${_basename}"=;<${_basename}>=") endmacro()