endif()
# Default to Debug for the build type
- set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
+ set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
# Do some cleanup
# We're using widl now for both MSVC and GCC builds
include(cmake/widl-support.cmake)
- if(MSVC AND USE_WDK_HEADERS)
- include_directories(
- include
- $ENV{SDK_INC_PATH}
- include/dxsdk
- ${REACTOS_BINARY_DIR}/include
- ${REACTOS_BINARY_DIR}/include/dxsdk
- ${REACTOS_BINARY_DIR}/include/psdk
- ${REACTOS_BINARY_DIR}/include/reactos
- $ENV{CRT_INC_PATH}
- $ENV{DDK_INC_PATH}
- include/ndk
- include/reactos
- include/reactos/libs)
- else()
- include_directories(
- include
- include/psdk
- include/dxsdk
- ${REACTOS_BINARY_DIR}/include
- ${REACTOS_BINARY_DIR}/include/psdk
- ${REACTOS_BINARY_DIR}/include/dxsdk
- ${REACTOS_BINARY_DIR}/include/reactos
- include/crt
- include/ddk
- include/ndk
- include/reactos
- include/reactos/libs)
- endif()
-
+ include_directories(
+ include
+ include/psdk
+ include/dxsdk
+ ${REACTOS_BINARY_DIR}/include
+ ${REACTOS_BINARY_DIR}/include/psdk
+ ${REACTOS_BINARY_DIR}/include/dxsdk
+ ${REACTOS_BINARY_DIR}/include/reactos
+ include/crt
+ include/ddk
+ include/ndk
+ include/reactos
+ include/reactos/libs)
if(ARCH STREQUAL "arm")
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm)
add_subdirectory(include/asm)
include(cmake/baseaddress.cmake)
-
+
# For MSVC builds, this puts all debug symbols file in the same directory.
set(CMAKE_PDB_OUTPUT_DIRECTORY "${REACTOS_BINARY_DIR}/msvc_pdb")
#define those for having real libraries
set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO <LINK_FLAGS> /OUT:<TARGET> <OBJECTS>")
-set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /Cp /Fo<OBJECT> /c /Ta <SOURCE>")
+set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <SOURCE>")
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()
- foreach(LIB ${ARGN})
- add_target_link_flags(${_module} "/DELAYLOAD:${LIB}.dll")
- target_link_libraries(${_module} lib${LIB})
+ foreach(_lib ${ARGN})
+ add_target_link_flags(${_module} "/DELAYLOAD:${_lib}.dll")
+ target_link_libraries(${_module} lib${_lib})
endforeach()
target_link_libraries(${_module} delayimp)
endfunction()
set CMAKE_GENERATOR="Ninja"\r
)\r
\r
-) else if defined DDK_TARGET_OS (\r
- echo Detected DDK/WDK for %DDK_TARGET_OS%-%_BUILDARCH%%\r
- set BUILD_ENVIRONMENT=WDK\r
- if "%_BUILDARCH%" == "x86" (\r
- set ARCH=i386\r
- ) else if "%_BUILDARCH%" == "AMD64" (\r
- set ARCH=amd64\r
- )\r
- set USE_VSCMD=1\r
- set USE_WDK_HEADERS=0\r
-\r
) else if defined VCINSTALLDIR (\r
:: VS command prompt does not put this in environment vars\r
cl 2>&1 | find "x86" > NUL && set ARCH=i386\r
cl 2>&1 | find "x64" > NUL && set ARCH=amd64\r
cl 2>&1 | find "ARM" > NUL && set ARCH=arm\r
- cl 2>&1 | find "14.00." > NUL && set BUILD_ENVIRONMENT=VS8\r
- cl 2>&1 | find "15.00." > NUL && set BUILD_ENVIRONMENT=VS9\r
cl 2>&1 | find "16.00." > NUL && set BUILD_ENVIRONMENT=VS10\r
cl 2>&1 | find "17.00." > NUL && set BUILD_ENVIRONMENT=VS11\r
- ::cl 2>&1 | find "18.00." > NUL && set BUILD_ENVIRONMENT=VS12\r
+ cl 2>&1 | find "18.00." > NUL && set BUILD_ENVIRONMENT=VS12\r
if not defined BUILD_ENVIRONMENT (\r
echo Error: Visual Studio version too old or version detection failed.\r
exit /b\r
\r
echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!-!ARCH!\r
if /I "%1" == "VSSolution" (\r
- if "!BUILD_ENVIRONMENT!" == "VS8" (\r
- if "!ARCH!" == "amd64" (\r
- set CMAKE_GENERATOR="Visual Studio 8 2005 Win64"\r
- ) else (\r
- set CMAKE_GENERATOR="Visual Studio 8 2005"\r
- )\r
- ) else if "!BUILD_ENVIRONMENT!" == "VS9" (\r
- if "!ARCH!" == "amd64" (\r
- set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"\r
- ) else (\r
- set CMAKE_GENERATOR="Visual Studio 9 2008"\r
- )\r
- ) else if "!BUILD_ENVIRONMENT!" == "VS10" (\r
+ if "!BUILD_ENVIRONMENT!" == "VS10" (\r
if "!ARCH!" == "amd64" (\r
set CMAKE_GENERATOR="Visual Studio 10 Win64"\r
) else (\r
) else (\r
set CMAKE_GENERATOR="Visual Studio 11"\r
)\r
+ ) else if "!BUILD_ENVIRONMENT!" == "VS12" (\r
+ if "!ARCH!" == "amd64" (\r
+ set CMAKE_GENERATOR="Visual Studio 12 Win64"\r
+ ) else if "!ARCH!" == "arm" (\r
+ set CMAKE_GENERATOR="Visual Studio 12 ARM"\r
+ ) else (\r
+ set CMAKE_GENERATOR="Visual Studio 12"\r
+ )\r
)\r
) else (\r
set USE_VSCMD=1\r
echo This script defaults to Ninja. To use Visual Studio GUI specify "VSSolution" as a parameter.\r
)\r
\r
-) else if defined sdkdir (\r
- echo Detected Windows SDK %TARGET_PLATFORM%-%TARGET_CPU%\r
- if "%TARGET_CPU%" == "x86" (\r
- set ARCH=i386\r
- ) else if "%TARGET_CPU%" == "x64" (\r
- set ARCH=amd64\r
- )\r
-\r
- set BUILD_ENVIRONMENT=SDK\r
- set USE_VSCMD=1\r
-\r
) else (\r
echo Error: Unable to detect build environment. Configure script failure.\r
exit /b\r
\r
if "%BUILD_ENVIRONMENT%" == "MinGW" (\r
cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE=0 -DPCH=0 -DCMAKE_TOOLCHAIN_FILE=toolchain-gcc.cmake -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%"\r
-) else if "%BUILD_ENVIRONMENT%" == "WDK" (\r
- cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE=toolchain-msvc.cmake -DUSE_WDK_HEADERS=%USE_WDK_HEADERS% -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%"\r
) else (\r
cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE=toolchain-msvc.cmake -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%"\r
)\r