2011-05-16 13:12:07 +00:00
|
|
|
|
2011-09-27 21:21:59 +00:00
|
|
|
# Show a note about ccache build
|
2014-02-12 18:36:46 +00:00
|
|
|
if(ENABLE_CCACHE)
|
2011-09-27 21:21:59 +00:00
|
|
|
message("-- Enabling ccache build - done")
|
2015-02-21 14:40:14 +00:00
|
|
|
set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
|
|
|
|
set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
|
2011-09-27 21:21:59 +00:00
|
|
|
endif()
|
|
|
|
|
2012-02-25 23:50:38 +00:00
|
|
|
# PDB style debug info
|
|
|
|
if(NOT DEFINED SEPARATE_DBG)
|
|
|
|
set(SEPARATE_DBG FALSE)
|
|
|
|
endif()
|
|
|
|
|
2014-10-03 09:56:36 +00:00
|
|
|
# Dwarf based builds (no rsym)
|
2015-06-15 16:43:11 +00:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
set(NO_ROSSYM TRUE)
|
|
|
|
elseif(NOT DEFINED NO_ROSSYM)
|
2014-10-03 09:56:36 +00:00
|
|
|
set(NO_ROSSYM FALSE)
|
|
|
|
endif()
|
|
|
|
|
2013-09-17 22:31:33 +00:00
|
|
|
if(NOT DEFINED USE_PSEH3)
|
2013-11-02 20:42:13 +00:00
|
|
|
set(USE_PSEH3 1)
|
2013-09-17 22:31:33 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(USE_PSEH3)
|
|
|
|
add_definitions(-D_USE_PSEH3=1)
|
|
|
|
endif()
|
|
|
|
|
2013-11-01 11:58:31 +00:00
|
|
|
if(NOT DEFINED USE_DUMMY_PSEH)
|
|
|
|
set(USE_DUMMY_PSEH 0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(USE_DUMMY_PSEH)
|
|
|
|
add_definitions(-D_USE_DUMMY_PSEH=1)
|
|
|
|
endif()
|
|
|
|
|
2014-10-04 20:26:14 +00:00
|
|
|
if(STACK_PROTECTOR)
|
|
|
|
add_compile_flags(${MODULE} "-fstack-protector-all")
|
|
|
|
endif()
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
# Compiler Core
|
2013-01-22 22:38:40 +00:00
|
|
|
add_compile_flags("-pipe -fms-extensions -fno-strict-aliasing")
|
2015-03-14 15:47:04 +00:00
|
|
|
|
|
|
|
# Prevent GCC from searching any of the default directories
|
|
|
|
add_compile_flags("-nostdinc")
|
|
|
|
|
2013-03-05 08:25:22 +00:00
|
|
|
if(GCC_VERSION VERSION_GREATER 4.7)
|
|
|
|
add_compile_flags("-mstackrealign")
|
2019-04-01 15:29:07 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GCC_VERSION VERSION_LESS 4.8)
|
2019-03-31 06:40:36 +00:00
|
|
|
add_compile_flags("-fno-aggressive-loop-optimizations")
|
2013-03-05 08:25:22 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-03-02 20:27:39 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
2014-09-09 18:42:43 +00:00
|
|
|
add_compile_flags_language("-std=gnu89 -Wno-microsoft" "C")
|
2014-09-07 12:36:26 +00:00
|
|
|
set(CMAKE_LINK_DEF_FILE_FLAG "")
|
2014-09-07 17:19:14 +00:00
|
|
|
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
|
|
|
set(CMAKE_LINK_LIBRARY_SUFFIX "")
|
2014-09-10 15:34:05 +00:00
|
|
|
set(CMAKE_CREATE_WIN32_EXE "")
|
2014-09-10 19:00:53 +00:00
|
|
|
set(CMAKE_C_COMPILE_OPTIONS_PIC "")
|
|
|
|
set(CMAKE_CXX_COMPILE_OPTIONS_PIC "")
|
|
|
|
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
|
|
|
|
set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
|
|
|
|
set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
|
|
|
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
2019-04-06 14:55:10 +00:00
|
|
|
set(CMAKE_SHARED_MODULE_C_FLAGS "")
|
|
|
|
set(CMAKE_SHARED_MODULE_CXX_FLAGS "")
|
2014-09-20 17:36:37 +00:00
|
|
|
set(CMAKE_ASM_FLAGS_DEBUG "")
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
2014-03-02 20:27:39 +00:00
|
|
|
endif()
|
|
|
|
|
2014-05-05 21:03:20 +00:00
|
|
|
if(DBG)
|
2014-09-07 12:36:26 +00:00
|
|
|
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_compile_flags_language("-Wold-style-declaration" "C")
|
|
|
|
endif()
|
|
|
|
add_compile_flags_language("-Wdeclaration-after-statement" "C")
|
2014-05-05 21:03:20 +00:00
|
|
|
endif()
|
2014-09-07 12:36:26 +00:00
|
|
|
|
2013-07-20 10:23:07 +00:00
|
|
|
add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX")
|
2013-06-22 14:44:56 +00:00
|
|
|
|
2012-03-01 18:38:22 +00:00
|
|
|
#bug
|
|
|
|
#file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE)
|
|
|
|
#workaround
|
2012-03-01 19:09:07 +00:00
|
|
|
set(REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR})
|
2012-08-27 18:58:27 +00:00
|
|
|
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
2012-03-01 20:29:18 +00:00
|
|
|
string(REPLACE "/" "\\" REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR})
|
2012-03-01 18:38:22 +00:00
|
|
|
endif()
|
2014-03-02 20:08:07 +00:00
|
|
|
|
2014-09-11 20:55:42 +00:00
|
|
|
if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT SEPARATE_DBG))
|
2014-03-02 20:08:07 +00:00
|
|
|
add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS")
|
|
|
|
endif()
|
2012-03-01 18:38:22 +00:00
|
|
|
|
2012-02-25 23:50:38 +00:00
|
|
|
# Debugging
|
2015-06-15 17:26:04 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
if(SEPARATE_DBG)
|
|
|
|
add_compile_flags("-gdwarf-2 -ggdb")
|
|
|
|
else()
|
|
|
|
add_compile_flags("-gdwarf-2 -gstrict-dwarf")
|
|
|
|
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols")
|
|
|
|
endif()
|
2014-03-02 20:08:07 +00:00
|
|
|
endif()
|
2012-02-25 23:50:38 +00:00
|
|
|
endif()
|
|
|
|
|
2011-09-03 23:05:09 +00:00
|
|
|
# For some reason, cmake sets -fPIC, and we don't want it
|
2011-09-05 12:41:18 +00:00
|
|
|
if(DEFINED CMAKE_SHARED_LIBRARY_ASM_FLAGS)
|
|
|
|
string(REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_ASM_FLAGS ${CMAKE_SHARED_LIBRARY_ASM_FLAGS})
|
|
|
|
endif()
|
2019-04-06 14:55:10 +00:00
|
|
|
if(DEFINED CMAKE_SHARED_MODULE_ASM_FLAGS)
|
|
|
|
string(REPLACE "-fPIC" "" CMAKE_SHARED_MODULE_ASM_FLAGS ${CMAKE_SHARED_MODULE_ASM_FLAGS})
|
|
|
|
endif()
|
2011-09-03 23:05:09 +00:00
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
# Tuning
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
2011-09-03 14:57:27 +00:00
|
|
|
add_compile_flags("-march=${OARCH} -mtune=${TUNE}")
|
2011-05-16 13:12:07 +00:00
|
|
|
else()
|
2011-09-03 14:57:27 +00:00
|
|
|
add_compile_flags("-march=${OARCH}")
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
|
|
|
|
2013-11-02 14:33:18 +00:00
|
|
|
# Warnings, errors
|
2015-06-15 18:48:38 +00:00
|
|
|
if((NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang"))
|
2014-03-02 22:11:49 +00:00
|
|
|
add_compile_flags("-Werror")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_compile_flags("-Wall -Wpointer-arith")
|
2014-03-02 20:08:07 +00:00
|
|
|
add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value")
|
|
|
|
|
|
|
|
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_compile_flags("-Wno-maybe-uninitialized")
|
|
|
|
endif()
|
|
|
|
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "amd64")
|
2011-09-03 14:57:27 +00:00
|
|
|
add_compile_flags("-Wno-format")
|
2012-08-27 18:58:27 +00:00
|
|
|
elseif(ARCH STREQUAL "arm")
|
2011-09-03 14:57:27 +00:00
|
|
|
add_compile_flags("-Wno-attributes")
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Optimizations
|
2015-06-15 18:59:46 +00:00
|
|
|
# FIXME: Revisit this to see if we even need these levels
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2015-10-30 10:03:44 +00:00
|
|
|
add_compile_flags("-O2 -DNDEBUG")
|
2015-06-15 18:59:46 +00:00
|
|
|
else()
|
|
|
|
if(OPTIMIZE STREQUAL "1")
|
|
|
|
add_compile_flags("-Os -ftracer")
|
|
|
|
elseif(OPTIMIZE STREQUAL "2")
|
|
|
|
add_compile_flags("-Os")
|
|
|
|
elseif(OPTIMIZE STREQUAL "3")
|
|
|
|
add_compile_flags("-Og")
|
|
|
|
elseif(OPTIMIZE STREQUAL "4")
|
|
|
|
add_compile_flags("-O1")
|
|
|
|
elseif(OPTIMIZE STREQUAL "5")
|
|
|
|
add_compile_flags("-O2")
|
|
|
|
elseif(OPTIMIZE STREQUAL "6")
|
|
|
|
add_compile_flags("-O3")
|
|
|
|
elseif(OPTIMIZE STREQUAL "7")
|
|
|
|
add_compile_flags("-Ofast")
|
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
|
|
|
|
2012-03-10 23:38:37 +00:00
|
|
|
# Link-time code generation
|
|
|
|
if(LTCG)
|
2014-08-15 11:12:09 +00:00
|
|
|
add_compile_flags("-flto -fno-fat-lto-objects")
|
2012-03-10 23:38:37 +00:00
|
|
|
endif()
|
|
|
|
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
2014-03-02 20:08:07 +00:00
|
|
|
add_compile_flags("-fno-optimize-sibling-calls -fno-omit-frame-pointer")
|
|
|
|
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable")
|
|
|
|
endif()
|
2013-11-17 22:11:04 +00:00
|
|
|
# FIXME: this doesn't work. CMAKE_BUILD_TYPE is always "Debug"
|
2013-01-22 22:38:40 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
add_compile_flags("-momit-leaf-frame-pointer")
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
2012-08-27 18:58:27 +00:00
|
|
|
elseif(ARCH STREQUAL "amd64")
|
2011-09-03 14:57:27 +00:00
|
|
|
add_compile_flags("-mpreferred-stack-boundary=4")
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Other
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "amd64")
|
2011-05-16 13:12:07 +00:00
|
|
|
add_definitions(-U_X86_ -UWIN32)
|
2012-08-27 18:58:27 +00:00
|
|
|
elseif(ARCH STREQUAL "arm")
|
2011-05-16 13:12:07 +00:00
|
|
|
add_definitions(-U_UNICODE -UUNICODE)
|
|
|
|
add_definitions(-D__MSVCRT__) # DUBIOUS
|
|
|
|
endif()
|
|
|
|
|
2012-01-26 19:09:02 +00:00
|
|
|
add_definitions(-D_inline=__inline)
|
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# Alternative arch name
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "amd64")
|
2011-05-16 13:12:07 +00:00
|
|
|
set(ARCH2 x86_64)
|
|
|
|
else()
|
|
|
|
set(ARCH2 ${ARCH})
|
|
|
|
endif()
|
|
|
|
|
2012-02-25 23:50:38 +00:00
|
|
|
if(SEPARATE_DBG)
|
|
|
|
# PDB style debug puts all dwarf debug info in a separate dbg file
|
2012-07-17 14:08:18 +00:00
|
|
|
message(STATUS "Building separate debug symbols")
|
|
|
|
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/symbols)
|
2012-08-27 18:58:27 +00:00
|
|
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
2018-10-30 16:23:42 +00:00
|
|
|
set(CMAKE_DEBUG_SYMBOL_SUFFIX "")
|
2012-07-17 14:08:18 +00:00
|
|
|
set(SYMBOL_FILE <TARGET_PDB>)
|
|
|
|
else()
|
2018-10-30 16:23:42 +00:00
|
|
|
set(SYMBOL_FILE <TARGET>)
|
2012-07-17 14:08:18 +00:00
|
|
|
endif()
|
2012-02-25 23:50:38 +00:00
|
|
|
set(OBJCOPY ${CMAKE_OBJCOPY})
|
|
|
|
set(CMAKE_C_LINK_EXECUTABLE
|
|
|
|
"<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
|
2012-07-17 14:08:18 +00:00
|
|
|
"${OBJCOPY} --only-keep-debug <TARGET> ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}"
|
2012-02-25 23:50:38 +00:00
|
|
|
"${OBJCOPY} --strip-debug <TARGET>")
|
|
|
|
set(CMAKE_CXX_LINK_EXECUTABLE
|
|
|
|
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
|
2012-07-17 14:08:18 +00:00
|
|
|
"${OBJCOPY} --only-keep-debug <TARGET> ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}"
|
2012-02-25 23:50:38 +00:00
|
|
|
"${OBJCOPY} --strip-debug <TARGET>")
|
|
|
|
set(CMAKE_C_CREATE_SHARED_LIBRARY
|
|
|
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
|
2012-07-17 14:08:18 +00:00
|
|
|
"${OBJCOPY} --only-keep-debug <TARGET> ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}"
|
2012-02-25 23:50:38 +00:00
|
|
|
"${OBJCOPY} --strip-debug <TARGET>")
|
|
|
|
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>"
|
2012-07-17 14:08:18 +00:00
|
|
|
"${OBJCOPY} --only-keep-debug <TARGET> ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}"
|
2012-02-25 23:50:38 +00:00
|
|
|
"${OBJCOPY} --strip-debug <TARGET>")
|
|
|
|
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>"
|
2012-07-17 14:08:18 +00:00
|
|
|
"${OBJCOPY} --only-keep-debug <TARGET> ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}"
|
2012-02-25 23:50:38 +00:00
|
|
|
"${OBJCOPY} --strip-debug <TARGET>")
|
2014-10-03 09:56:36 +00:00
|
|
|
elseif(NO_ROSSYM)
|
|
|
|
# Dwarf-based build
|
|
|
|
message(STATUS "Generating a dwarf-based build (no rsym)")
|
|
|
|
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
|
|
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
|
|
set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
|
|
|
set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <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_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
2012-02-25 23:50:38 +00:00
|
|
|
else()
|
|
|
|
# Normal rsym build
|
2015-09-06 16:44:30 +00:00
|
|
|
if(NEW_STYLE_BUILD)
|
|
|
|
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
|
|
|
|
get_target_property(RSYM native-rsym IMPORTED_LOCATION_${_build_type})
|
|
|
|
else()
|
|
|
|
get_target_property(RSYM native-rsym IMPORTED_LOCATION_NOCONFIG)
|
|
|
|
endif()
|
|
|
|
|
2012-02-25 23:50:38 +00:00
|
|
|
set(CMAKE_C_LINK_EXECUTABLE
|
2012-03-10 23:38:37 +00:00
|
|
|
"<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
|
2013-08-18 20:05:32 +00:00
|
|
|
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
|
2012-02-25 23:50:38 +00:00
|
|
|
set(CMAKE_CXX_LINK_EXECUTABLE
|
2012-03-10 23:38:37 +00:00
|
|
|
"<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
|
2013-08-18 20:05:32 +00:00
|
|
|
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
|
2012-02-25 23:50:38 +00:00
|
|
|
set(CMAKE_C_CREATE_SHARED_LIBRARY
|
2012-03-10 23:38:37 +00:00
|
|
|
"<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
|
2013-08-18 20:05:32 +00:00
|
|
|
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
|
2012-02-25 23:50:38 +00:00
|
|
|
set(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
2012-03-10 23:38:37 +00:00
|
|
|
"<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
|
2013-08-18 20:05:32 +00:00
|
|
|
"${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
|
2012-02-25 23:50:38 +00:00
|
|
|
set(CMAKE_RC_CREATE_SHARED_LIBRARY
|
2013-07-18 21:03:01 +00:00
|
|
|
"<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
2012-02-25 23:50:38 +00:00
|
|
|
endif()
|
2011-06-13 10:36:40 +00:00
|
|
|
|
2019-03-20 13:19:48 +00:00
|
|
|
set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
|
|
|
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
|
|
|
set(CMAKE_RC_CREATE_SHARED_MODULE ${CMAKE_RC_CREATE_SHARED_LIBRARY})
|
|
|
|
|
2011-09-18 00:57:17 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import,--disable-stdcall-fixup")
|
2011-06-13 10:36:40 +00:00
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup")
|
2019-03-20 13:19:48 +00:00
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup")
|
2011-06-13 10:36:40 +00:00
|
|
|
|
2015-06-15 17:35:29 +00:00
|
|
|
if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Release"))
|
2015-06-15 17:45:24 +00:00
|
|
|
# FIXME: Set this once Clang toolchain works with it
|
2014-03-02 20:08:07 +00:00
|
|
|
set(_compress_debug_sections_flag "-Wa,--compress-debug-sections")
|
|
|
|
endif()
|
|
|
|
|
2016-11-13 10:19:22 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.4.0)
|
|
|
|
set(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES> ${_compress_debug_sections_flag} <FLAGS> -o <OBJECT> -c <SOURCE>")
|
|
|
|
# FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to CXX too
|
|
|
|
set(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
|
|
|
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> ${_compress_debug_sections_flag} -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
|
2011-06-13 10:36:40 +00:00
|
|
|
|
2016-11-13 10:19:22 +00:00
|
|
|
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE> <OBJECT>")
|
|
|
|
else()
|
|
|
|
set(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES> ${_compress_debug_sections_flag} <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
|
|
|
# FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to CXX too
|
|
|
|
set(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
|
|
|
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> ${_compress_debug_sections_flag} -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm <INCLUDES> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
|
|
|
|
|
|
|
|
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <INCLUDES> <FLAGS> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE> <OBJECT>")
|
|
|
|
endif()
|
2013-01-22 22:38:40 +00:00
|
|
|
set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \"${MINGW_TOOLCHAIN_PREFIX}gcc${MINGW_TOOLCHAIN_SUFFIX} -E -xc-header -MMD -MF <DEPFILE> -MT <OBJECT>\" ")
|
2011-05-16 13:12:07 +00:00
|
|
|
|
|
|
|
# Optional 3rd parameter: stdcall stack bytes
|
2011-08-08 11:45:34 +00:00
|
|
|
function(set_entrypoint MODULE ENTRYPOINT)
|
2011-05-16 13:12:07 +00:00
|
|
|
if(${ENTRYPOINT} STREQUAL "0")
|
2011-09-03 14:57:27 +00:00
|
|
|
add_target_link_flags(${MODULE} "-Wl,-entry,0")
|
2012-08-27 18:58:27 +00:00
|
|
|
elseif(ARCH STREQUAL "i386")
|
2011-05-16 13:12:07 +00:00
|
|
|
set(_entrysymbol _${ENTRYPOINT})
|
2011-10-02 18:59:33 +00:00
|
|
|
if(${ARGC} GREATER 2)
|
2011-05-16 13:12:07 +00:00
|
|
|
set(_entrysymbol ${_entrysymbol}@${ARGV2})
|
|
|
|
endif()
|
2011-09-03 14:57:27 +00:00
|
|
|
add_target_link_flags(${MODULE} "-Wl,-entry,${_entrysymbol}")
|
2011-05-16 13:12:07 +00:00
|
|
|
else()
|
2011-09-03 14:57:27 +00:00
|
|
|
add_target_link_flags(${MODULE} "-Wl,-entry,${ENTRYPOINT}")
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2011-08-08 11:45:34 +00:00
|
|
|
function(set_subsystem MODULE SUBSYSTEM)
|
2017-07-13 20:50:49 +00:00
|
|
|
add_target_link_flags(${MODULE} "-Wl,--subsystem,${SUBSYSTEM}:5.01")
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2011-08-08 11:45:34 +00:00
|
|
|
function(set_image_base MODULE IMAGE_BASE)
|
2011-09-03 14:57:27 +00:00
|
|
|
add_target_link_flags(${MODULE} "-Wl,--image-base,${IMAGE_BASE}")
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2011-09-03 17:48:57 +00:00
|
|
|
function(set_module_type_toolchain MODULE TYPE)
|
2013-06-22 14:44:56 +00:00
|
|
|
if(CPP_USE_STL)
|
2013-04-02 18:42:39 +00:00
|
|
|
if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver"))
|
2013-06-22 14:44:56 +00:00
|
|
|
message(FATAL_ERROR "Use of STL in kernelmodedriver or wdmdriver type module prohibited")
|
2013-04-02 18:42:39 +00:00
|
|
|
endif()
|
2013-06-22 14:44:56 +00:00
|
|
|
target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex)
|
|
|
|
elseif(CPP_USE_RT)
|
|
|
|
target_link_libraries(${MODULE} -lsupc++ -lgcc)
|
|
|
|
elseif(IS_CPP)
|
|
|
|
target_link_libraries(${MODULE} -lgcc)
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
|
|
|
|
2013-04-02 08:08:36 +00:00
|
|
|
if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver"))
|
2011-09-18 00:57:17 +00:00
|
|
|
add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000")
|
2013-04-02 08:08:36 +00:00
|
|
|
if(${TYPE} STREQUAL "wdmdriver")
|
|
|
|
add_target_link_flags(${MODULE} "-Wl,--wdmdriver")
|
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
2014-10-04 20:26:14 +00:00
|
|
|
|
|
|
|
if(STACK_PROTECTOR)
|
|
|
|
target_link_libraries(${MODULE} gcc_ssp)
|
|
|
|
endif()
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-07-14 11:44:21 +00:00
|
|
|
function(add_delay_importlibs _module)
|
|
|
|
get_target_property(_module_type ${_module} TYPE)
|
|
|
|
if(_module_type STREQUAL "STATIC_LIBRARY")
|
|
|
|
message(FATAL_ERROR "Cannot add delay imports to a static library")
|
|
|
|
endif()
|
2013-07-14 21:00:42 +00:00
|
|
|
foreach(_lib ${ARGN})
|
2017-12-31 12:08:39 +00:00
|
|
|
get_filename_component(_basename "${_lib}" NAME_WE)
|
|
|
|
target_link_libraries(${_module} lib${_basename}_delayed)
|
2011-06-10 20:44:47 +00:00
|
|
|
endforeach()
|
2013-07-14 11:44:21 +00:00
|
|
|
target_link_libraries(${_module} delayimp)
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-06-10 20:44:47 +00:00
|
|
|
|
2012-08-27 18:58:27 +00:00
|
|
|
if(NOT ARCH STREQUAL "i386")
|
2011-05-16 13:12:07 +00:00
|
|
|
set(DECO_OPTION "-@")
|
|
|
|
endif()
|
|
|
|
|
2012-04-29 19:04:02 +00:00
|
|
|
function(generate_import_lib _libname _dllname _spec_file)
|
2014-03-24 20:54:01 +00:00
|
|
|
# Generate the def for the import lib
|
2012-04-29 19:04:02 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def
|
2015-02-07 23:54:15 +00:00
|
|
|
COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} ${ARGN} --implib -d=${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
2012-04-29 19:04:02 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def)
|
|
|
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def PROPERTIES EXTERNAL_OBJECT TRUE)
|
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# Create normal importlib
|
2012-04-29 19:04:02 +00:00
|
|
|
_add_library(${_libname} STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def)
|
|
|
|
set_target_properties(${_libname} PROPERTIES LINKER_LANGUAGE "IMPLIB" PREFIX "")
|
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# Create delayed importlib
|
2012-04-29 19:04:02 +00:00
|
|
|
_add_library(${_libname}_delayed STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def)
|
|
|
|
set_target_properties(${_libname}_delayed PROPERTIES LINKER_LANGUAGE "IMPLIB_DELAYED" PREFIX "")
|
|
|
|
endfunction()
|
|
|
|
|
2012-02-21 14:32:05 +00:00
|
|
|
# Cute little hack to produce import libs
|
|
|
|
set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def <OBJECTS> --kill-at --output-lib=<TARGET>")
|
|
|
|
set(CMAKE_IMPLIB_DELAYED_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def <OBJECTS> --kill-at --output-delaylib=<TARGET>")
|
2011-08-08 11:45:34 +00:00
|
|
|
function(spec2def _dllname _spec_file)
|
2014-09-25 18:25:02 +00:00
|
|
|
|
2018-09-05 19:59:16 +00:00
|
|
|
cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;NO_PRIVATE_WARNINGS;WITH_RELAY" "VERSION" "" ${ARGN})
|
2012-04-20 12:39:00 +00:00
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# Get library basename
|
2012-03-07 21:21:27 +00:00
|
|
|
get_filename_component(_file ${_dllname} NAME_WE)
|
2012-04-20 12:39:00 +00:00
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# Error out on anything else than spec
|
2012-03-07 21:21:27 +00:00
|
|
|
if(NOT ${_spec_file} MATCHES ".*\\.spec")
|
|
|
|
message(FATAL_ERROR "spec2def only takes spec files as input.")
|
2011-08-15 15:36:25 +00:00
|
|
|
endif()
|
|
|
|
|
2014-09-25 18:25:02 +00:00
|
|
|
if (__spec2def_WITH_RELAY)
|
|
|
|
set(__with_relay_arg "--with-tracing")
|
|
|
|
endif()
|
|
|
|
|
2018-09-05 19:59:16 +00:00
|
|
|
if(__spec2def_VERSION)
|
|
|
|
set(__version_arg "--version=0x${__spec2def_VERSION}")
|
|
|
|
endif()
|
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# Generate exports def and C stubs file for the DLL
|
2011-05-16 13:12:07 +00:00
|
|
|
add_custom_command(
|
2011-06-26 21:29:55 +00:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c
|
2018-09-05 19:59:16 +00:00
|
|
|
COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
|
2011-08-05 20:40:40 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def)
|
2012-04-02 15:27:35 +00:00
|
|
|
|
2014-09-25 18:25:02 +00:00
|
|
|
if(__spec2def_ADD_IMPORTLIB)
|
2015-02-07 23:54:15 +00:00
|
|
|
set(_extraflags)
|
|
|
|
if(__spec2def_NO_PRIVATE_WARNINGS)
|
|
|
|
set(_extraflags --no-private-warnings)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
generate_import_lib(lib${_file} ${_dllname} ${_spec_file} ${_extraflags})
|
2012-03-07 21:21:27 +00:00
|
|
|
endif()
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2011-10-03 19:09:26 +00:00
|
|
|
macro(macro_mc FLAG FILE)
|
2016-09-28 23:20:20 +00:00
|
|
|
set(COMMAND_MC ${CMAKE_MC_COMPILER} -u ${FLAG} -b -h ${CMAKE_CURRENT_BINARY_DIR}/ -r ${CMAKE_CURRENT_BINARY_DIR}/ ${FILE})
|
2011-05-16 13:12:07 +00:00
|
|
|
endmacro()
|
|
|
|
|
2014-03-24 20:54:01 +00:00
|
|
|
# PSEH lib, needed with mingw
|
2011-05-16 13:12:07 +00:00
|
|
|
set(PSEH_LIB "pseh")
|
2011-06-02 12:18:22 +00:00
|
|
|
|
|
|
|
# Macros
|
2015-03-14 14:55:41 +00:00
|
|
|
if(PCH AND (NOT ENABLE_CCACHE) AND (NOT CMAKE_HOST_APPLE))
|
2014-04-17 13:49:49 +00:00
|
|
|
add_compile_flags("-Winvalid-pch -Werror=invalid-pch")
|
2014-02-12 19:55:12 +00:00
|
|
|
macro(add_pch _target _pch _sources)
|
|
|
|
# When including x.h GCC looks for x.h.gch first
|
|
|
|
set(_pch_final_name "${_target}_pch.h")
|
|
|
|
set(_gch ${CMAKE_CURRENT_BINARY_DIR}/${_pch_final_name}.gch)
|
2011-06-07 23:22:38 +00:00
|
|
|
|
2011-07-25 19:05:00 +00:00
|
|
|
if(IS_CPP)
|
2014-02-12 19:55:12 +00:00
|
|
|
set(_pch_language CXX)
|
2011-07-25 19:05:00 +00:00
|
|
|
else()
|
2014-02-12 19:55:12 +00:00
|
|
|
set(_pch_language C)
|
2011-07-25 19:05:00 +00:00
|
|
|
endif()
|
2011-06-02 12:18:22 +00:00
|
|
|
|
2014-02-12 19:55:12 +00:00
|
|
|
# Build the precompiled header
|
|
|
|
# HEADER_FILE_ONLY FALSE: force compiling the header
|
|
|
|
# EXTERNAL_SOURCE TRUE: don't use the .gch file when linking
|
|
|
|
set_source_files_properties(${_pch} PROPERTIES
|
|
|
|
HEADER_FILE_ONLY FALSE
|
|
|
|
LANGUAGE ${_pch_language}
|
|
|
|
EXTERNAL_SOURCE TRUE
|
|
|
|
OBJECT_LOCATION ${_gch})
|
|
|
|
|
|
|
|
# Include the gch in the specified source files, skipping the pch file itself
|
|
|
|
list(REMOVE_ITEM ${_sources} ${_pch})
|
|
|
|
foreach(_src ${${_sources}})
|
2014-09-23 17:43:18 +00:00
|
|
|
set_property(SOURCE ${_src} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_ccache_flag} -include ${CMAKE_CURRENT_BINARY_DIR}/${_pch_final_name}")
|
2014-02-12 19:55:12 +00:00
|
|
|
set_property(SOURCE ${_src} APPEND PROPERTY OBJECT_DEPENDS ${_gch})
|
2011-09-04 18:41:04 +00:00
|
|
|
endforeach()
|
2011-07-25 19:05:00 +00:00
|
|
|
endmacro()
|
|
|
|
else()
|
2014-02-12 22:12:52 +00:00
|
|
|
macro(add_pch _target _pch _sources)
|
2011-07-25 19:05:00 +00:00
|
|
|
endmacro()
|
|
|
|
endif()
|
2011-06-07 23:22:38 +00:00
|
|
|
|
2012-04-20 12:39:00 +00:00
|
|
|
function(CreateBootSectorTarget _target_name _asm_file _binary_file _base_address)
|
2011-06-09 13:56:44 +00:00
|
|
|
set(_object_file ${_binary_file}.o)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_object_file}
|
2016-04-20 12:36:25 +00:00
|
|
|
COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm -I${REACTOS_SOURCE_DIR}/boot/freeldr -D__ASM__ -c ${_asm_file}
|
2011-06-09 13:56:44 +00:00
|
|
|
DEPENDS ${_asm_file})
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_binary_file}
|
|
|
|
COMMAND native-obj2bin ${_object_file} ${_binary_file} ${_base_address}
|
|
|
|
# COMMAND objcopy --output-target binary --image-base 0x${_base_address} ${_object_file} ${_binary_file}
|
2011-08-05 20:40:40 +00:00
|
|
|
DEPENDS ${_object_file} native-obj2bin)
|
2011-06-09 13:56:44 +00:00
|
|
|
|
|
|
|
set_source_files_properties(${_object_file} ${_binary_file} PROPERTIES GENERATED TRUE)
|
|
|
|
|
|
|
|
add_custom_target(${_target_name} ALL DEPENDS ${_binary_file})
|
2011-08-08 11:45:34 +00:00
|
|
|
endfunction()
|
2011-09-04 17:32:30 +00:00
|
|
|
|
|
|
|
function(allow_warnings __module)
|
2015-04-19 08:39:58 +00:00
|
|
|
# We don't allow warnings in trunk, this needs to be reworked. See CORE-6959.
|
|
|
|
#add_target_compile_flags(${__module} "-Wno-error")
|
2011-09-04 17:32:30 +00:00
|
|
|
endfunction()
|
2013-01-08 20:33:08 +00:00
|
|
|
|
|
|
|
macro(add_asm_files _target)
|
|
|
|
list(APPEND ${_target} ${ARGN})
|
|
|
|
endmacro()
|
2019-02-09 23:43:31 +00:00
|
|
|
|
|
|
|
function(add_linker_script _target _linker_script_file)
|
|
|
|
get_filename_component(_file_full_path ${_linker_script_file} ABSOLUTE)
|
|
|
|
add_target_link_flags(${_target} "-Wl,-T,${_file_full_path}")
|
|
|
|
|
|
|
|
# Unfortunately LINK_DEPENDS is ignored in non-Makefile generators (for now...)
|
|
|
|
# See also http://www.cmake.org/pipermail/cmake/2010-May/037206.html
|
|
|
|
add_target_property(${_target} LINK_DEPENDS ${_file_full_path})
|
|
|
|
endfunction()
|