mosra / toolchains Goto Github PK
View Code? Open in Web Editor NEWToolchains for crosscompiling with CMake.
Home Page: https://magnum.graphics/
License: The Unlicense
Toolchains for crosscompiling with CMake.
Home Page: https://magnum.graphics/
License: The Unlicense
When enable IPO for CMake, it defaults to ThinLTO on Clang which is much faster than normal LTO, but does occasionally run into issues. #14 brings us part of the way there and immediately solves the issue with Full LTO.
One of the main blockers is a bug in the EMSDK Toolchain here: emscripten-core/emscripten#12763 but there is also a workaround in the first issue about the naming of the archive libraries and object files. We should look into solving that in this toolchain as well.
The Emscripten upstream backend uses the standard -flto
option and emits a warning when --llvm-lto
is used.
emcc:WARNING: --llvm-lto ignored when using llvm backend
One way to check whether the fastcomp backend is being used is to check for Clang 6.0.1 or older. Fastcomp stopped being supported with Emscripten > 1.40.1 which has that version. Upstream as old as 1.38.33 (oldest version I could get from emsdk) uses Clang 9.
However, the following doesn't work because the toolchain file doesn't have access the compiler version (CMAKE_CXX_COMPILER_VERSION
is only detected by CMake afterwards):
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "-O3 --llvm-lto 1")
else()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "-O3 -flto")
endif()
I fixed it with a
string(REPLACE "--llvm-lto 1" "-flto" CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
in my code but the correct flag in the toolchain depending on the backend would be nicer.
I've just managed to get up to apk packaging completing, and now trying to debug, I've initially tried importing the APK through Android Studio (option: Profile or debug APK
), but I'm getting errors when selecting the cmake built file:
APK Import
Unable to find file
'Users/hkim809/ApkProjects/MyApplication/small/classes.dex'
Any ideas?
toolchains/generic/Emscripten-wasm.cmake
Line 17 in d7beaed
Hi,
there is a typo
if(DEFIEND ENV{EMSCRIPTEN})
should be
if(DEFINED ENV{EMSCRIPTEN})
Best,
Tomas
Hi, I'm trying to build sdl2 from sources here: https://github.com/SDL-mirror/SDL
The cmake config goes fine with the ios toolchain, but builds fail complaining about missing headers, etc.
I use the following steps:
mkdir build-ios && cd build-ios
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \
-DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" \
-DCMAKE_INSTALL_PREFIX=~/ios-libs \
-G Xcode
cmake --build .
Creating an issue here s.t. this can be addressed when
https://developercommunity.visualstudio.com/t/Debug-android-device-through-cmake-proje/10087552
this is given a reply to.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.