.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

@ -38,7 +38,7 @@ IF(NOT ANDROID)
src/fg_geometry.c src/fg_geometry.c
src/fg_menu.c src/fg_menu.c
src/fg_teapot.c src/fg_teapot.c
) )
ENDIF() ENDIF()
IF(WIN32) IF(WIN32)
@ -57,7 +57,15 @@ IF(WIN32)
src/mswin/fg_state_mswin.c src/mswin/fg_state_mswin.c
src/mswin/fg_structure_mswin.c src/mswin/fg_structure_mswin.c
src/mswin/fg_window_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) ELSEIF(ANDROID)
LIST(APPEND FREEGLUT_SRCS LIST(APPEND FREEGLUT_SRCS
src/egl/fg_internal_egl.h src/egl/fg_internal_egl.h
@ -77,7 +85,7 @@ ELSEIF(ANDROID)
src/android/fg_window_android.c src/android/fg_window_android.c
src/android/opengles_stubs.c src/android/opengles_stubs.c
src/android/fg_internal_android.h src/android/fg_internal_android.h
) )
ELSE() ELSE()
LIST(APPEND FREEGLUT_SRCS LIST(APPEND FREEGLUT_SRCS
src/x11/fg_cursor_x11.c src/x11/fg_cursor_x11.c
@ -96,9 +104,7 @@ ELSE()
src/x11/fg_structure_x11.c src/x11/fg_structure_x11.c
src/x11/fg_window_x11.c src/x11/fg_window_x11.c
src/x11/fg_xinput_x11.c src/x11/fg_xinput_x11.c
) )
ENDIF() ENDIF()
# Neatly organize all of the output files in the build directory # Neatly organize all of the output files in the build directory
@ -209,15 +215,24 @@ ENDIF()
IF(WIN32) IF(WIN32)
LIST(APPEND LIBS winmm) LIST(APPEND LIBS winmm)
IF(BUILD_SHARED_LIBS) 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) 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() ENDIF()
IF(BUILD_STATIC_LIBS) IF(BUILD_STATIC_LIBS)
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC) 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() ENDIF()
ELSE() ELSE()
# on UNIX we need to make sure: # on UNIX we need to make sure:

View File

@ -1,5 +1,5 @@
LIBRARY freeglut LIBRARY freeglut
VERSION 2.6 VERSION 3.0
EXPORTS EXPORTS
glutInit glutInit
glutInitWindowPosition glutInitWindowPosition
@ -144,8 +144,8 @@ EXPORTS
glutInitContextFlags glutInitContextFlags
glutInitContextVersion glutInitContextVersion
glutInitContextProfile glutInitContextProfile
glutInitErrorFunc glutInitErrorFunc
glutInitWarningFunc glutInitWarningFunc
__glutInitWithExit __glutInitWithExit
__glutCreateWindowWithExit __glutCreateWindowWithExit
__glutCreateMenuWithExit __glutCreateMenuWithExit