mirror of https://github.com/bjornbytes/lovr.git
don't include main/winmain in dll build
otherwise the parent app can't define a main of its own
This commit is contained in:
parent
62a2d01daf
commit
9c37a6cdc8
|
@ -351,7 +351,9 @@ if(LOVR_USE_PICO)
|
|||
endif()
|
||||
|
||||
if(LOVR_BUILD_SHARED)
|
||||
list(REMOVE_ITEM LOVR_SRC src/main.c)
|
||||
add_library(lovr SHARED ${LOVR_SRC})
|
||||
target_compile_definitions(lovr PRIVATE LOVR_BUILDING_SHARED)
|
||||
elseif(LOVR_BUILD_EXE)
|
||||
add_executable(lovr ${LOVR_SRC})
|
||||
else()
|
||||
|
@ -601,8 +603,10 @@ if(WIN32)
|
|||
target_sources(lovr PRIVATE src/core/os_win32.c)
|
||||
target_sources(lovr PRIVATE src/resources/lovr.rc)
|
||||
set_target_properties(lovr PROPERTIES COMPILE_FLAGS "/wd4244 /MP")
|
||||
set_target_properties(lovr PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:console /ENTRY:WinMainCRTStartup")
|
||||
set_target_properties(lovr PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:windows /ENTRY:WinMainCRTStartup")
|
||||
if(NOT LOVR_BUILD_SHARED)
|
||||
set_target_properties(lovr PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:console /ENTRY:WinMainCRTStartup")
|
||||
set_target_properties(lovr PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:windows /ENTRY:WinMainCRTStartup")
|
||||
endif()
|
||||
target_compile_definitions(lovr PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
target_compile_definitions(lovr PRIVATE _CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
static uint64_t frequency;
|
||||
|
||||
#ifndef LOVR_BUILDING_SHARED
|
||||
|
||||
int main(int argc, char** argv);
|
||||
|
||||
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prev, LPSTR args, int show) {
|
||||
|
@ -49,6 +51,8 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prev, LPSTR args, int show) {
|
|||
return status;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool os_init() {
|
||||
LARGE_INTEGER f;
|
||||
QueryPerformanceFrequency(&f);
|
||||
|
|
Loading…
Reference in New Issue