Skip to content

Commit

Permalink
skip GTK detection if we're cross-compiling (#588)
Browse files Browse the repository at this point in the history
It seems that stlink cannot use CMake's standard mechanism to find GTK3.
Cmake's GTK3 detection supports only Unix at the moment.

Therefore, stlink uses pkg-config to find GTK3. The downside of this is
that Cmake's cross-compiler settings are not taken into account. Even if
we're cross-compiling, CMake will find a local installation of GTK3 and
compilation of the GUI fails.

As a simple fix, we skip the GTK3 detection if we're cross-compiling.

(In the long run, we should use a more advanced mechanism to find GTK3.)
  • Loading branch information
martin-kaiser authored and xor-gate committed May 5, 2017
1 parent 3d24377 commit cc3a570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include(cmake/CFlags.cmake)
# Dependencies
###
find_package(LibUSB REQUIRED)
if (NOT APPLE AND NOT WIN32)
if (NOT APPLE AND NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
find_package(PkgConfig)
pkg_check_modules(gtk gtk+-3.0)
endif ()
Expand Down

0 comments on commit cc3a570

Please sign in to comment.