PROJECT(CHARMAP)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
include_directories(
includes)
-add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
-
-if(NOT MSVC)
- add_compile_flags("-Wno-restrict")
-endif()
-
list(APPEND SOURCE
src/ansiprsr.cpp
src/keytrans.cpp
src/ttelhndl.cpp
precomp.h)
-if(NOT MSVC)
- add_compile_flags_language("-Wno-narrowing" "CXX")
-endif()
-
add_executable(telnet ${SOURCE} telnet.rc)
target_link_libraries(telnet cppstl)
set_target_cpp_properties(telnet WITH_EXCEPTIONS)
+if (NOT MSVC)
+ target_compile_options(telnet PRIVATE -Wno-restrict $<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>)
+ target_compile_definitions(telnet PRIVATE _CRT_NONSTDC_NO_DEPRECATE)
+endif()
set_module_type(telnet win32cui)
add_importlibs(telnet ws2_32 user32 msvcrt kernel32 ntdll)
add_pch(telnet precomp.h SOURCE)
project(appcompat)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
include_directories(
${REACTOS_SOURCE_DIR}/dll/appcompat/apphelp
${REACTOS_SOURCE_DIR})
add_definitions(
-D_WINE)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
file(GLOB_RECURSE mydocs_rc_deps res/*.*)
add_rc_deps(mydocs.rc ${mydocs_rc_deps})
project(SHELL)
-
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11 -Wshadow" "CXX")
-endif()
-
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
project(SHELL)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
spec2def(ntobjshex.dll ntobjshex.spec)
file(GLOB_RECURSE ntobjshex_rc_deps resources/*.*)
add_definitions(
-D_WINE)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
file(GLOB_RECURSE sendmail_rc_deps res/*.*)
add_rc_deps(sendmail.rc ${sendmail_rc_deps})
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x603)
-if(NOT MSVC)
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
include_directories(${REACTOS_SOURCE_DIR}/drivers/filesystems/btrfs)
spec2def(shellbtrfs.dll shellbtrfs.spec)
project(SHELL)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
spec2def(stobject.dll stobject.spec)
file(GLOB_RECURSE stobject_rc_deps resources/*.*)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
spec2def(zipfldr.dll zipfldr.spec ADD_IMPORTLIB)
-
list(APPEND SOURCE
zipfldr.cpp
zippidl.cpp
zipfldr.rc
${CMAKE_CURRENT_BINARY_DIR}/zipfldr.def)
-
set_module_type(zipfldr win32dll UNICODE)
target_link_libraries(zipfldr minizip zlib uuid cpprt atl_classes)
set_target_cpp_properties(zipfldr WITH_EXCEPTIONS)
spec2def(devmgr.dll devmgr.spec ADD_IMPORTLIB)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
include_directories(
${REACTOS_SOURCE_DIR}/sdk/include/reactos/dll
includes)
spec2def(shell32.dll shell32.spec ADD_IMPORTLIB)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
add_driver_inf(netkvm netkvm.inf)
if(NOT MSVC)
- add_compile_flags("-Wno-unused-function")
- add_compile_flags("-Wno-old-style-declaration")
- add_compile_flags("-Wno-unknown-pragmas")
- add_compile_flags("-Wno-unused-but-set-variable")
- add_compile_flags("-Wno-pointer-sign")
- add_compile_flags("-Wno-pointer-to-int-cast")
- add_compile_flags("-Wno-int-to-pointer-cast")
- add_compile_flags("-Wno-attributes")
+ target_compile_options(netkvm PRIVATE
+ -Wno-unused-function
+ -Wno-old-style-declaration
+ -Wno-unknown-pragmas
+ -Wno-unused-but-set-variable
+ -Wno-pointer-sign
+ -Wno-pointer-to-int-cast
+ -Wno-int-to-pointer-cast
+ -Wno-attributes)
endif()
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
include_directories(
includes)
testlist.c)
add_executable(browseui_apitest ${SOURCE})
+
target_link_libraries(browseui_apitest uuid wine cpprt atl_classes)
set_target_cpp_properties(browseui_apitest WITH_EXCEPTIONS WITH_RTTI)
set_module_type(browseui_apitest win32cui)
endmacro(replace_compiler_option)
# add_compile_flags
-# add_compile_flags_language
# Add or replace compiler flags in the global scope for either all source
# files or only those of the specified language.
#
# Examples:
# add_compile_flags("-pedantic -O5")
-# add_compile_flags_language("-std=gnu99" "C")
function(add_compile_flags _flags)
if(${ARGC} GREATER 1)
message(FATAL_ERROR "Excess arguments to add_compile_flags! Args ${ARGN}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${_flags}" PARENT_SCOPE)
endfunction()
-
-function(add_compile_flags_language _flags _lang)
- if(NOT ${ARGC} EQUAL 2)
- message(FATAL_ERROR "Wrong arguments to add_compile_flags_language! Args ${ARGN}")
- endif()
- # Adds the compiler flag for the specified language only, e.g. CMAKE_C_FLAGS
- set(CMAKE_${_lang}_FLAGS "${CMAKE_${_lang}_FLAGS} ${_flags}" PARENT_SCOPE)
-endfunction()
-
add_compile_flags("-fno-aggressive-loop-optimizations")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_compile_flags_language("-std=gnu99 -Wno-microsoft" "C")
+ add_compile_options("$<$<COMPILE_LANGUAGE:C>:-std=gnu99;-Wno-microsoft>")
set(CMAKE_LINK_DEF_FILE_FLAG "")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_LINK_LIBRARY_SUFFIX "")
if(DBG)
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
- add_compile_flags_language("-Wold-style-declaration" "C")
+ add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>")
endif()
endif()
add_compile_flags("/w14115")
if(USE_CLANG_CL)
- add_compile_flags_language("-nostdinc -Wno-multichar -Wno-char-subscripts -Wno-microsoft-enum-forward-reference -Wno-pragma-pack -Wno-microsoft-anon-tag -Wno-parentheses-equality -Wno-unknown-pragmas" "C")
- add_compile_flags_language("-nostdinc -Wno-multichar -Wno-char-subscripts -Wno-microsoft-enum-forward-reference -Wno-pragma-pack -Wno-microsoft-anon-tag -Wno-parentheses-equality -Wno-unknown-pragmas" "CXX")
+ add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-nostdinc;-Wno-multichar;-Wno-char-subscripts;-Wno-microsoft-enum-forward-reference;-Wno-pragma-pack;-Wno-microsoft-anon-tag;-Wno-parentheses-equality;-Wno-unknown-pragmas>")
endif()
# Debugging
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_IO_H=1)
- add_compile_flags_language("/EHsc" "CXX")
+ add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/EHsc>")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
- add_compile_flags("/wd4267")
+ add_compile_options("/wd4267")
endif()
add_host_tool(bin2c bin2c.c)
set(USE_DIBLIB FALSE)
-if(NOT MSVC)
- # HACK: this should be enabled globally!
- add_compile_flags_language("-std=c++11" "CXX")
-endif()
-
# Give WIN32 subsystem its own project.
PROJECT(WIN32SS)
add_asm_files(win32ksys_asm sys-stubs.S)
add_library(win32ksys ${win32ksys_asm})
set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C")
-add_dependencies(win32ksys asm)
\ No newline at end of file
+add_dependencies(win32ksys asm)