Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
Update CMakeLists.txt to allow cross compiling on Linux for Windows.

Pass -DCMAKE_CXX_FLAGS="$(CXXFLAGS) -DCYGWIN=1" to cmake so right PRETTY_FUNC is used in markdown.cpp when -DWIN32 is set somewhere else.
Pass -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)  -Wl,--whole-archive -liconv -Wl,--no-whole-archive" (and make sure win-iconv is in library search path. https://github.com/win-iconv/win-iconv)
  • Loading branch information
nwrkbiz committed Dec 9, 2020
1 parent 979ea24 commit 7eff1f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ endif()

if (WIN32)
if ((NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles") AND
(NOT CMAKE_GENERATOR MATCHES "MSYS Makefiles"))
(NOT CMAKE_GENERATOR MATCHES "MSYS Makefiles") AND
(NOT CMAKE_GENERATOR MATCHES "Unix Makefiles"))
if (NOT ICONV_DIR)
set(ICONV_DIR "${PROJECT_SOURCE_DIR}/winbuild")
endif()
Expand Down

0 comments on commit 7eff1f2

Please sign in to comment.