Code Monkey home page Code Monkey logo

mso's Introduction

Mso C++ Library

This project provides parts of C++ library which has been used extensively by Microsoft Office Apps. It can make it easier to share robust cross-platform C++ code between teams within Microsoft and outside.

Mso C++ Library currently contains following components:

  • Mso::UnknownObject
  • Mso::Functor

Development Requirements

Windows

  • Visual Studio 2019

MacOS

  • XCode

Linux

  • Visual Studio Code

Build Environment Preparation Steps

These steps need to be performed only once.

  1. (Windows) Open VS Developer Command Prompt for VS 2019

  2. Create a "build" folder

mkdir build
cd build
  1. Configure the build.
cmake ..

Build

  1. (Windows) Open VS Developer Command Prompt for VS 2019

  2. Navigate to "build" folder

cd build
  1. Build
cmake --build .

Run Tests

  1. (Windows) Open VS Developer Command Prompt for VS 2019

  2. Navigate to "build" folder

cd build
  1. Run Unit Tests
ctest -C Debug

Code of Conduct

See Code of Conduct

Contributing

See Contributing

mso's People

Contributors

afoxman avatar dannyvv avatar dependabot-preview[bot] avatar microsoftopensource avatar msftgits avatar nikoari avatar rnsdkbot avatar sid-dahiya avatar vmoroz avatar zacharyhenkel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mso's Issues

Build failure on 64-bit macOS

Perhaps unsurprising since APEX tooling is so different:

~/Development ❯❯❯ cd Mso
~/D/Mso ❯❯❯ mkdir build
~/D/Mso ❯❯❯ cd build
~/D/M/build ❯❯❯ cmake ..
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Liblet platform: WIN32
-- Liblet test runner: GTEST
-- Enable testing: ON
-- Enable includes checks: ON
-- The C compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.16")
-- Defining liblet Mso::compilerAdapters
-- Defining liblet Mso::comUtil
-- Defining liblet Mso::cppExtensions
-- Defining liblet Mso::cppType
-- Defining liblet Mso::crash
-- Defining liblet Mso::debugAssertApi
-- Defining liblet Mso::eventWaitHandle
-- Defining liblet Mso::functional
-- Defining liblet Mso::memoryApi
-- Defining liblet Mso::motifCpp
-- Defining liblet Mso::oacr
-- Defining liblet Mso::oacr_posix
-- Defining liblet Mso::object
-- Defining liblet Mso::platformAdapters
-- Defining liblet Mso::platform_posix
-- Defining liblet Mso::smartPtr
-- Defining liblet Mso::tagUtils
All targets: compilerAdapters;comUtil;cppExtensions;cppType;crash;debugAssertApi;eventWaitHandle;functional;memoryApi;motifCpp;oacr;oacr_posix;object;platformAdapters;platform_posix;smartPtr;tagUtils;compilerAdapters_verify_includes;compilerAdapters_verify_includes_custom;compilerAdapters_verify_includes;compilerAdapters_verify_includes_custom;comUtil_verify_includes;comUtil_verify_includes_custom;comUtil_verify_includes;comUtil_verify_includes_custom;cppExtensions_verify_includes;cppExtensions_verify_includes_custom;cppExtensions_verify_includes;cppExtensions_verify_includes_custom;cppType_verify_includes;cppType_verify_includes_custom;cppType_verify_includes;cppType_verify_includes_custom;crash_verify_includes;crash_verify_includes_custom;crash_verify_includes;crash_verify_includes_custom;debugAssertApi_verify_includes;debugAssertApi_verify_includes_custom;debugAssertApi_verify_includes;debugAssertApi_verify_includes_custom;eventWaitHandle_verify_includes;eventWaitHandle_verify_includes_custom;eventWaitHandle_verify_includes;eventWaitHandle_verify_includes_custom;eventWaitHandle_tests;functional_verify_includes;functional_verify_includes_custom;functional_verify_includes;functional_verify_includes_custom;functional_tests;memoryApi_verify_includes;memoryApi_verify_includes_custom;memoryApi_verify_includes;memoryApi_verify_includes_custom;motifCpp_verify_includes;motifCpp_verify_includes_custom;motifCpp_verify_includes;motifCpp_verify_includes_custom;oacr_verify_includes;oacr_verify_includes_custom;oacr_verify_includes;oacr_verify_includes_custom;object_verify_includes;object_verify_includes_custom;object_verify_includes;object_verify_includes_custom;object_tests;platformAdapters_verify_includes;platformAdapters_verify_includes_custom;platformAdapters_verify_includes;platformAdapters_verify_includes_custom;smartPtr_verify_includes;smartPtr_verify_includes_custom;smartPtr_verify_includes;smartPtr_verify_includes_custom;tagUtils_verify_includes;tagUtils_verify_includes_custom;tagUtils_verify_includes;tagUtils_verify_includes_custom;gmock;gmock_main;gmock;gmock_main;gtest;gtest_main;gtest;gtest_main
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/benbader/Development/Mso/build
~/D/M/build ❯❯❯ make
make[1]: Entering directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
Scanning dependencies of target gtest
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
[  1%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[  1%] Linking CXX static library ../../../lib/libgtest.a
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
[  1%] Built target gtest
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
Scanning dependencies of target gmock
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
[  1%] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
[  2%] Linking CXX static library ../../../lib/libgmock.a
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
[  2%] Built target gmock
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
Scanning dependencies of target gmock_main
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
[  3%] Building CXX object _deps/googletest-build/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o
[  4%] Linking CXX static library ../../../lib/libgmock_main.a
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
[  4%] Built target gmock_main
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
Scanning dependencies of target gtest_main
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
[  5%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[  6%] Linking CXX static library ../../../lib/libgtest_main.a
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
[  6%] Built target gtest_main
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
Scanning dependencies of target compilerAdapters
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
[  7%] Building CXX object libs/compilerAdapters/CMakeFiles/compilerAdapters.dir/__/__/tools/cmake/empty.cpp.o
[  7%] Linking CXX static library libcompilerAdapters.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcompilerAdapters.a(empty.cpp.o) has no symbols
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: libcompilerAdapters.a the table of contents is empty (no object file members in the library define global symbols)
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
[  7%] Built target compilerAdapters
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
Scanning dependencies of target compilerAdapters_verify_includes
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[2]: Entering directory '/Users/benbader/Development/Mso/build'
[  8%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/compilerFeatures.h.cpp.o
[  9%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/compilerWarnings.h.cpp.o
[ 10%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/compilerWarnings_impl.h.cpp.o
[ 11%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/cppMacros.h.cpp.o
[ 12%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/cppMacrosDebug.h.cpp.o
[ 12%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/declspecDefinitions.h.cpp.o
[ 13%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/functionDecorations.h.cpp.o
[ 14%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/intrinsics.h.cpp.o
[ 15%] Building CXX object libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/linker.h.cpp.o
In file included from /Users/benbader/Development/Mso/build/libs/compilerAdapters/include/verify/linker.h.cpp:1:
/Users/benbader/Development/Mso/libs/compilerAdapters/include/compilerAdapters/linker.h:36:2: error: Unknown Platform!
#error Unknown Platform!
 ^
/Users/benbader/Development/Mso/libs/compilerAdapters/include/compilerAdapters/linker.h:59:2: error: Unknown Platform!
#error Unknown Platform!
 ^
2 errors generated.
make[2]: *** [libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/build.make:167: libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/verify/linker.h.cpp.o] Error 1
make[2]: Leaving directory '/Users/benbader/Development/Mso/build'
make[1]: *** [CMakeFiles/Makefile2:1269: libs/compilerAdapters/include/CMakeFiles/compilerAdapters_verify_includes.dir/all] Error 2
make[1]: Leaving directory '/Users/benbader/Development/Mso/build'
make: *** [Makefile:141: all] Error 2

Something about an undefined platform. It's been long enough since I've been inside of MSFT that I don't feel confident trying to guess what needs to happen. Possibly just defining _M_X64?

...also, kudos on getting some of this stuff out into the open! I was just waxing lyrical about RefCountedObject tonight when I learned about this repo. It makes me happy to see it again.

Add futures and dispatch queues

Along with TCntPtr, my favorite bits of MSO were the futures and the IDispatchQueue family. It would be lovely to see these here - particularly as I see they were opened for use in ReactHost elsewhere. Thanks again.

No support for targeting an architecture for Windows platforms

When MSO_LIBLET_PLATFORM is set to WIN32 or WINRT, developers need a way to configure the target machine architecture: x86, x64, or arm.

They can set the necessary environment variables using vcvarsall/vcvars32/vcvars64, but the CMake scripts don't account for machine architecture when configuring the compiler or linker, nor when placing/naming files.

Support for Debug builds

Mso has debug-only code in headers and C++ files, yet there is no way to tell Mso to build in debug mode. This is typically done by setting CMAKE_BUILD_TYPE = Debug.

Android support

Add necessary CMake logic to generate an Android linkable library and unit tests.

Linux port

Adds support for building on Linux environments using the GCC compiler collection.

Reference environment:

  • Ubuntu 18.04 x64
  • GCC 7.4.0
  • Make 4.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.