Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extraneous compiler macros, Windows #30

Closed
andrewseidl opened this issue Jan 13, 2015 · 0 comments
Closed

Remove extraneous compiler macros, Windows #30

andrewseidl opened this issue Jan 13, 2015 · 0 comments

Comments

@andrewseidl
Copy link
Contributor

Re:

chrono/src/CMakeLists.txt

Lines 187 to 207 in 3e65d05

IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
IF (MSVC)
ADD_DEFINITIONS( "-D_CRT_SECURE_NO_DEPRECATE" ) # avoids deprecation warnings
ADD_DEFINITIONS( "-D_SCL_SECURE_NO_DEPRECATE" ) # avoids deprecation warnings
ENDIF(MSVC)
IF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC")
SET (CH_BUILDFLAGS "-DWIN32; -DNOMINMAX; -MP")
SET (CH_LINKERFLAG_SHARED "/FORCE:MULTIPLE")
ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC_X64")
SET (CH_BUILDFLAGS "-DWIN64; -D_WIN64; -DNOMINMAX; -MP")
SET (CH_LINKERFLAG_SHARED "/FORCE:MULTIPLE")
ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_GCC")
SET (CH_BUILDFLAGS "-DWIN32 -D_MINGW -D_WINDOWS")
SET (CH_LINKERFLAG_EXE "-Wl,--enable-runtime-pseudo-reloc")
SET (CH_LINKERFLAG_SHARED "-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc")
ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_GCC_X64")
SET (CH_BUILDFLAGS "-DWIN64 -D_MINGW -D_WINDOWS -m64")
SET (CH_LINKERFLAG_EXE "-Wl,--enable-runtime-pseudo-reloc")
SET (CH_LINKERFLAG_SHARED "-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc")
ENDIF()
ENDIF()

It should be possible to remove a number of predefined compiler macros from this section since they are already set by the compiler. Specifically, _WIN64 will be defined when compiling on 64bit and _WIN32 will be defined on 32bit and 64bit. MinGW also has a standard set of macros.

Approximately 23 source files will need to be updated to reflect these changes.

andrewseidl added a commit to andrewseidl/chrono that referenced this issue Apr 29, 2015
_WIN32 and _WIN64 are predefined macros, so it is not necessary to have an
additional macro named WIN32 or WIN64.

Additionally, _WIN32 is defined on both 32- and 64-bit builds.

Resolves projectchrono#30.
andrewseidl added a commit to jcmadsen/chrono that referenced this issue Apr 29, 2015
_WIN32 and _WIN64 are predefined by the compiler, so it is not necessary to
have an additional macro named WIN32 or WIN64.

Additionally, _WIN32 is defined on both 32- and 64-bit builds.

Resolves projectchrono#30.
rserban added a commit that referenced this issue Jun 8, 2015
Capsule and rounded cylinder included in utils generator
gitbook-com bot pushed a commit to Concrete-Chrono-Development/chrono-concrete that referenced this issue Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant