- Replace add_linkerflag and add_compiler_flags with their new equivalents add_target_link_flags/add_compile_flags
- Remove those now obsolete macros
- Use the new set_module_type to get rid of evil hacks for drivers without entry point (wmilib, drmk)
svn path=/trunk/; revision=53558
endif()
add_definitions(/Dinline=__inline)
else()
- add_compiler_flags(-fshort-wchar)
+ add_compile_flags("-fshort-wchar")
endif()
include_directories(include/host)
set_property(TARGET ${_module} PROPERTY ${_propname} ${_newvalue})
endfunction()
-#
-# For backwards compatibility. To be removed soon.
-#
-function(add_compiler_flags)
- set(flags_list "")
- # Adds the compiler flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
- foreach(flag ${ARGN})
- set(flags_list "${flags_list} ${flag}")
- endforeach()
-
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flags_list}" PARENT_SCOPE)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flags_list}" PARENT_SCOPE)
-endfunction()
-
-function(add_linkerflag MODULE _flag)
- if (${ARGC} GREATER 2)
- message(STATUS "Excess arguments to add_linkerflag! Module ${MODULE}, args ${ARGN}")
- endif()
- set(NEW_LINKER_FLAGS ${_flag})
- get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
- if(LINKER_FLAGS)
- set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
- endif()
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
-endfunction()
-
-# New versions, using add_target_property where appropriate.
+# Wrapper functions for the important properties, using add_target_property
+# where appropriate.
# Note that the functions for string properties take a single string
# argument while those for list properties can take a variable number of
# arguments, all of which will be added to the list
# add_compile_flags("-pedantic -O5")
# add_target_link_flags(mymodule "-s --fatal-warnings")
# add_target_compile_flags(mymodule "-pedantic -O5")
-# add_target_compile_definitions(mymodule WIN32 _WIN32)
+# add_target_compile_definitions(mymodule WIN32 _WIN32 INLINE=inline)
# add_target_include_directories(mymodule include ../include)
function(add_compile_flags _flags)
if (${ARGC} GREATER 1)
if(NOT MSVC)
- add_compiler_flags(-w)
+ add_compile_flags("-w")
endif()
add_definitions(
set_module_type(ntdll win32dll ENTRYPOINT 0)
if(MSVC)
- add_linkerflag(ntdll /RELEASE)
+ add_target_link_flags(ntdll "/RELEASE")
endif()
target_link_libraries(ntdll
-DROS_Headers)
if (MSVC)
- add_compiler_flags(/EHa-)
+ add_compile_flags("/EHa-")
endif()
remove_definitions(-D_WIN32_WINNT=0x502)
if(MSVC)
# export of deleting destructor "name"
- add_linkerflag(msvcrt "/ignore:4102")
+ add_target_link_flags(msvcrt "/ignore:4102")
endif()
add_importlibs(msvcrt kernel32 ntdll)
if(MSVC)
# export of deleting destructor "name"
- add_linkerflag(msvcrt20 "/ignore:4102")
+ add_target_link_flags(msvcrt20 "/ignore:4102")
endif()
add_importlibs(msvcrt20 kernel32 ntdll)
if(MSVC)
# export of deleting destructor "name"
- add_linkerflag(msvcrt40 "/ignore:4102")
+ add_target_link_flags(msvcrt40 "/ignore:4102")
endif()
add_importlibs(msvcrt40 kernel32 ntdll)
-DLIBXML_STATIC)
if(MSVC)
- add_compiler_flags(/FIwine/typeof.h /FImsvc.h)
+ add_compile_flags("/FIwine/typeof.h /FImsvc.h")
endif(MSVC)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
set_rc_compiler()
if(MSVC)
- add_compiler_flags(/FItypeof.h)
+ add_compile_flags("/FItypeof.h")
endif()
spec2def(windowscodecs.dll windowscodecs.spec)
add_library(drmk SHARED ${SOURCE})
-if(NOT MSVC)
- set_module_type(drmk kernelmodedriver)
-else()
- set_target_properties(drmk PROPERTIES SUFFIX ".sys")
- set_subsystem(drmk native)
- set_image_base(drmk 0x00010000)
- add_linkerflag(drmk "/DRIVER")
- add_dependencies(drmk bugcodes)
- add_dependencies(drmk psdk)
-endif()
+set_module_type(drmk kernelmodedriver ENTRYPOINT 0)
-set_entrypoint(drmk 0)
add_importlibs(drmk ntoskrnl)
add_importlib_target(drmk.spec)
add_cd_file(TARGET drmk DESTINATION reactos/system32/drivers FOR all)
add_library(wmilib SHARED ${SOURCE})
-if(NOT MSVC)
- set_module_type(wmilib kernelmodedriver)
-else()
- set_target_properties(wmilib PROPERTIES SUFFIX ".sys")
- set_subsystem(wmilib native)
- set_image_base(wmilib 0x00010000)
- add_linkerflag(wmilib "/DRIVER")
- add_dependencies(wmilib bugcodes)
- add_dependencies(wmilib psdk)
-endif()
+set_module_type(wmilib kernelmodedriver ENTRYPOINT 0)
-set_entrypoint(wmilib 0)
-set_target_properties(wmilib PROPERTIES SUFFIX ".sys")
add_importlibs(wmilib ntoskrnl)
add_importlib_target(wmilib.spec)
add_cd_file(TARGET wmilib DESTINATION reactos/system32/drivers FOR all)
add_definitions(-D_CRTBLD)
if(NOT MSVC)
- add_definitions(-Wno-main)
+ add_compile_flags("-Wno-main")
endif()
list(APPEND MINGW_COMMON_SOURCE
add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST)
if(NOT MSVC)
- add_compiler_flags(-Wpointer-arith -Wwrite-strings)
+ add_compile_flags("-Wpointer-arith -Wwrite-strings")
endif()
add_library(inflibhost ${GLOBAL_FILES} ${SOURCE})
target_link_libraries(inflibhost unicode)
include_directories(include/internal/mingw-w64)
if(NOT MSVC)
- add_compiler_flags(-Wno-main)
+ add_compile_flags("-Wno-main")
endif()
list(APPEND MSVCRTEX_SOURCE