Skip to content

Commit

Permalink
cmake build-all script added
Browse files Browse the repository at this point in the history
- vsct compiled menu is now put to a proper intermediate directory, so that vs extension doesn't get re-linked.
  • Loading branch information
tyoma committed Nov 20, 2019
1 parent a1f0fea commit 60e84d5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
18 changes: 1 addition & 17 deletions build-cmake.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,7 @@
set NDK=C:\android\android-ndk-r20-linux\
set WSLENV=NDK/p:CMAKE_TOOLCHAIN_FILE/p

echo 1. Building Android binaries...
mkdir %~dp0\_build.android.arm
cd %~dp0\_build.android.arm
wsl cmake .. -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=c++_static
wsl make -j4

echo 2. Building Linux (x86_64) binaries...
mkdir %~dp0\_build.linux.x86_64
cd %~dp0\_build.linux.x86_64
wsl cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" -DCMAKE_C_FLAGS="-m64"
wsl make -j4

echo 3. Building Linux (x86) binaries...
mkdir %~dp0\_build.linux.x86
cd %~dp0\_build.linux.x86
wsl cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_C_FLAGS="-m32"
wsl make -j4
wsl bash ./build.sh

echo 4. Building Windows (x64) binaries...
mkdir %~dp0\_build.windows.x64
Expand Down
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
echo Building Android binaries...
mkdir _build.android.arm
cd _build.android.arm
cmake .. -DCMAKE_TOOLCHAIN=/mnt/c/android/android-ndk-r20-linux/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=c++_static
make -j4
cd ..

echo "Building Linux (x86_64) binaries..."
mkdir _build.linux.x86_64
cd _build.linux.x86_64
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" -DCMAKE_C_FLAGS="-m64"
make -j4
cd ..

echo "Building Linux (x86) binaries..."
mkdir _build.linux.x86
cd _build.linux.x86
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_C_FLAGS="-m32"
make -j4
cd ..
8 changes: 4 additions & 4 deletions micro-profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ set(VSSDKROOT $ENV{VSSDK100Install}/VisualStudioIntegration)
set(VSSDKINCLUDE ${VSSDKROOT}/Common/Inc)
set(VSSDKLIB ${VSSDKROOT}/Common/Lib)
set(VSSDKBIN ${VSSDKROOT}/Tools/Bin)
set(MP_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
set(MP_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
set(MP_OUTDIR $<TARGET_FILE_DIR:micro-profiler_frontend>)

include_directories(.)
include_directories(compat)
include_directories(${VSSDKINCLUDE})
include_directories(${MP_INTDIR})

add_custom_command(OUTPUT commands.cto
add_custom_command(OUTPUT ${MP_INTDIR}/commands.cto
COMMAND "${VSSDKBIN}/vsct.exe" "${CMAKE_CURRENT_SOURCE_DIR}/visualstudio/vs-extension/commands.vsct" "${MP_INTDIR}/commands.cto" -I"${VSSDKINCLUDE}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/visualstudio/vs-extension/commands.vsct"
COMMENT "Compiling vsct..."
Expand Down Expand Up @@ -48,13 +48,13 @@ set(MICROPROFILER_SOURCES
../frontend/src/untested/resources/frontend.rc

micro-profiler.pkgdef
commands.cto
${MP_INTDIR}/commands.cto
)

set(MICROPROFILER_UI_SOURCES
resources/micro-profiler_ui.rc

commands.cto
${MP_INTDIR}/commands.cto
)

add_library(micro-profiler_frontend SHARED ${MICROPROFILER_SOURCES})
Expand Down

0 comments on commit 60e84d5

Please sign in to comment.