mirror of
https://github.com/reactos/reactos.git
synced 2024-09-11 05:12:43 +00:00
![Jérôme Gardou](/assets/img/avatar_default.png)
Instead of messing with global variables and the like, we introduce two target properties: - WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions - WITH_CXX_RTTI: if you need RTTI in your module You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments We also introduce two libraries : - cpprt: for C++ runtime routines - cppstl: for the C++ standard template library NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++ Finally, we manage the relevant flags with the ad-hoc generator expressions So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module
60 lines
1.7 KiB
CMake
60 lines
1.7 KiB
CMake
|
|
#uncomment this if you want to test c++ compilation
|
|
#add_subdirectory(test)
|
|
|
|
list(APPEND SOURCE
|
|
src/allocators.cpp
|
|
src/bitset.cpp
|
|
src/codecvt.cpp
|
|
src/collate.cpp
|
|
src/complex.cpp
|
|
src/complex_io.cpp
|
|
src/complex_trig.cpp
|
|
src/ctype.cpp
|
|
src/dll_main.cpp
|
|
src/facets_byname.cpp
|
|
src/fstream.cpp
|
|
src/ios.cpp
|
|
src/iostream.cpp
|
|
src/istream.cpp
|
|
src/locale.cpp
|
|
src/locale_catalog.cpp
|
|
src/locale_impl.cpp
|
|
src/messages.cpp
|
|
src/monetary.cpp
|
|
src/num_get.cpp
|
|
src/num_get_float.cpp
|
|
src/num_put.cpp
|
|
src/num_put_float.cpp
|
|
src/numpunct.cpp
|
|
src/ostream.cpp
|
|
src/sstream.cpp
|
|
src/stdio_streambuf.cpp
|
|
src/string.cpp
|
|
src/strstream.cpp
|
|
src/time_facets.cpp
|
|
src/stlport_prefix.h)
|
|
|
|
add_library(stlport
|
|
${SOURCE}
|
|
src/cxa.c
|
|
src/c_locale.c)
|
|
|
|
if(USE_CLANG_CL)
|
|
target_compile_options(stlport PRIVATE -Wno-missing-braces -Wno-unused-local-typedef)
|
|
target_compile_options(stlport PRIVATE -Wno-infinite-recursion -Wno-deprecated-register)
|
|
target_compile_options(stlport PRIVATE -Wno-tautological-unsigned-zero-compare)
|
|
endif()
|
|
|
|
target_include_directories(stlport PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport)
|
|
target_compile_definitions(stlport PRIVATE
|
|
_STLP_USE_EXCEPTIONS _DLL __USE_CRTIMP
|
|
_BUILD_STLPORT NATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++)
|
|
|
|
target_include_directories(stlport INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport>")
|
|
target_compile_definitions(stlport INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:NATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++>")
|
|
set_target_cpp_properties(stlport WITH_EXCEPTIONS WITH_RTTI)
|
|
|
|
add_dependencies(stlport xdk)
|
|
add_pch(stlport src/stlport_prefix.h SOURCE)
|