Skip to content

Commit

Permalink
Merged PR 1096935: Build on Linux
Browse files Browse the repository at this point in the history
A bug on the CMakeLists.txt file that zlib provides makes zlib fail to compile when is used via add_subdirectory() by another project. For some reason, this issue only happens for Linux.

There's an already existing open PR since Feb 2017 with the fix (madler/zlib#219). This PR changes the zlib submodule to point to that commit.
  • Loading branch information
msftrubengu committed Nov 14, 2017
1 parent 18454fd commit 9a780f3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ ELSE()
ENDIF()
IF (LINUX)
MESSAGE (STATUS "Building for Linux")
# Static libraries must be position independent to be linked with a shared object.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
ENDIF()
ENDIF()

Expand Down
2 changes: 1 addition & 1 deletion lib/zlib
Submodule zlib updated 1 files
+1 −1 CMakeLists.txt
10 changes: 10 additions & 0 deletions makelinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# script to build on mac
mkdir .vs
cd .vs

# clean up any old builds of xPlatAppx modules
find . -name *xPlatAppx* -d | xargs rm -r

cmake -DLINUX=on ..
make
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)

add_subdirectory(xPlatAppx)
add_subdirectory(MakeXPlat)
add_subdirectory(MakeXplat)

ADD_DEPENDENCIES(MakeXplat xPlatAppx)
ADD_DEPENDENCIES(MakeXplat xPlatAppx)

0 comments on commit 9a780f3

Please sign in to comment.