Merge pull request #154 from randy408/symbol

win32: fix symbol exports
This commit is contained in:
Recep Aslantas
2020-08-04 21:05:28 +03:00
committed by GitHub
3 changed files with 14 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ if(CGLM_USE_C99)
endif()
if(MSVC)
add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL)
add_compile_options(/W3 /Ox /Gy /Oi /TC)
# Ref: https://skia.googlesource.com/third_party/sdl/+/refs/heads/master/CMakeLists.txt#225
@@ -75,6 +75,12 @@ add_library(${PROJECT_NAME}
src/affine2d.c
)
if(CGLM_SHARED)
add_definitions(-DCGLM_EXPORTS)
else()
target_compile_definitions(${PROJECT_NAME} PUBLIC -DCGLM_STATIC)
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})

View File

@@ -23,7 +23,9 @@
#include <stdbool.h>
#if defined(_MSC_VER)
# ifdef CGLM_DLL
# ifdef CGLM_STATIC
# define CGLM_EXPORT
# elif defined(CGLM_EXPORTS)
# define CGLM_EXPORT __declspec(dllexport)
# else
# define CGLM_EXPORT __declspec(dllimport)

View File

@@ -209,7 +209,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<PrecompiledHeaderFile />
@@ -225,7 +225,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>true</WholeProgramOptimization>
@@ -246,7 +246,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<PrecompiledHeaderFile />
<CompileAs>CompileAsC</CompileAs>
@@ -266,7 +266,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<PrecompiledHeaderFile />
<CompileAs>CompileAsC</CompileAs>