-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added instructions to cross compile on linux for windows
build a statically linked executable
- Loading branch information
Showing
6 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### Build for windows on linux | ||
|
||
Assuming the host platform is "arch linux". | ||
|
||
install from [AUR](https://aur.archlinux.org/): | ||
1. mingw-w64-gcc-base | ||
2. mingw-w64-gcc | ||
3. mingw-w64-libiconv | ||
|
||
After that you will have following tool chains available: | ||
|
||
- /usr/i686-w64-mingw32 | ||
- /usr/x86_64-w64-mingw32 | ||
|
||
|
||
git checkout https://github.com/ferkulat/csv2xls.git | ||
cd csv2xls | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/modules/Toolchain-mingw.cmake .. | ||
cmake --build . | ||
|
||
This builds with tool chain 'i686-w64-mingw32'. If you want to build with another tool chain, you need to change it in file 'Toolchain-mingw.cmake' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# the name of the target operating system | ||
SET(CMAKE_SYSTEM_NAME Windows) | ||
|
||
SET(MINGW_CHAIN i686-w64-mingw32) | ||
SET(I_USE_MINGW true) | ||
# which compilers to use for C and C++ | ||
SET(CMAKE_C_COMPILER ${MINGW_CHAIN}-gcc) | ||
SET(CMAKE_CXX_COMPILER ${MINGW_CHAIN}-g++) | ||
SET(CMAKE_RC_COMPILER ${MINGW_CHAIN}-windres) | ||
|
||
# here is the target environment located | ||
SET(CMAKE_FIND_ROOT_PATH /usr/${MINGW_CHAIN} ) | ||
|
||
# adjust the default behaviour of the FIND_XXX() commands: | ||
# search headers and libraries in the target environment, search | ||
# programs in the host environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters