.def and .rc file were appended to source list AFTER target was defined,

so moved them up in the file
now setting target machine for linker, or we get in trouble at least
with static libs on x64


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1118 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2012-03-12 05:07:35 +00:00
parent d3496a2968
commit b2159329f2
2 changed files with 29 additions and 14 deletions

View File

@ -57,7 +57,15 @@ IF(WIN32)
src/mswin/fg_state_mswin.c
src/mswin/fg_structure_mswin.c
src/mswin/fg_window_mswin.c
freeglut.rc
)
IF (NOT CMAKE_CL_64)
# .def file only for 32bit Windows builds
LIST(APPEND FREEGLUT_SRCS
src/freeglutdll.def
)
ENDIF()
ELSEIF(ANDROID)
LIST(APPEND FREEGLUT_SRCS
src/egl/fg_internal_egl.h
@ -97,8 +105,6 @@ ELSE()
src/x11/fg_window_x11.c
src/x11/fg_xinput_x11.c
)
ENDIF()
# Neatly organize all of the output files in the build directory
@ -209,15 +215,24 @@ ENDIF()
IF(WIN32)
LIST(APPEND LIBS winmm)
IF(BUILD_SHARED_LIBS)
LIST(APPEND FREEGLUT_SRCS freeglut.rc)
IF (NOT CMAKE_CL_64)
# .def file only for 32bit Windows builds
LIST(APPEND FREEGLUT_SRCS src/Common/freeglutdll.def)
ENDIF()
SET_TARGET_PROPERTIES(freeglut PROPERTIES COMPILE_FLAGS -DFREEGLUT_EXPORTS)
IF (CMAKE_CL_64)
# 64bit build
SET_TARGET_PROPERTIES(freeglut PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
ELSE()
# 32bit build
SET_TARGET_PROPERTIES(freeglut PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x86")
ENDIF()
ENDIF()
IF(BUILD_STATIC_LIBS)
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC)
IF (CMAKE_CL_64)
# 64bit build
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
ELSE()
# 32bit build
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x86")
ENDIF()
ENDIF()
ELSE()
# on UNIX we need to make sure:

View File

@ -1,5 +1,5 @@
LIBRARY freeglut
VERSION 2.6
VERSION 3.0
EXPORTS
glutInit
glutInitWindowPosition