diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c6e29be9d..0a200cbfa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,13 +135,6 @@ set(AURORA_ENABLE_RMLUI ON CACHE BOOL "Enable RmlUi UI support" FORCE) add_subdirectory(extern/aurora EXCLUDE_FROM_ALL) target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1) -# rmlui_core uses its own PCH which creates a duplicate PCH marker symbol when linked -# Disabling rmlui's PCH removes the conflicting marker and lets the link succeed -if (MSVC AND TARGET rmlui_core) - set_target_properties(rmlui_core PROPERTIES DISABLE_PRECOMPILE_HEADERS ON) -endif () - - add_subdirectory(libs/freeverb) option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)") @@ -528,10 +521,16 @@ if(ANDROID) elseif(WIN32) add_library(dusklight_game SHARED ${DUSK_FILES}) set_target_properties(dusklight_game PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS ON + WINDOWS_EXPORT_ALL_SYMBOLS ${DUSK_ENABLE_CODE_MODS} OUTPUT_NAME dusklight PDB_NAME dusklight_game) + # rmlui_core uses its own PCH which creates a duplicate PCH marker symbol when linked + # Disabling rmlui's PCH removes the conflicting marker and lets the link succeed + if (MSVC AND TARGET rmlui_core AND DUSK_ENABLE_CODE_MODS) + set_target_properties(rmlui_core PROPERTIES DISABLE_PRECOMPILE_HEADERS ON) + endif () + add_executable(dusklight WIN32 src/dusk/launcher_win32.cpp) target_link_libraries(dusklight PRIVATE dusklight_game) target_include_directories(dusklight PRIVATE include) @@ -794,4 +793,6 @@ foreach (target IN LISTS BINARY_TARGETS) endforeach () endforeach () -add_subdirectory(tools/mod_test) \ No newline at end of file +if (DUSK_ENABLE_CODE_MODS) + add_subdirectory(tools/mod_test) +endif () diff --git a/src/dusk/launcher_win32.cpp b/src/dusk/launcher_win32.cpp index c434febd78..8f060634e4 100644 --- a/src/dusk/launcher_win32.cpp +++ b/src/dusk/launcher_win32.cpp @@ -8,7 +8,7 @@ #include // see src/dusk/main.cpp -extern "C" int WINAPI dusk_WinMain(HINSTANCE hInst, HINSTANCE hPrev, PWSTR cmd, int show); +int dusk_WinMain(HINSTANCE hInst, HINSTANCE hPrev, PWSTR cmd, int show); int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, PWSTR cmd, int show) { return dusk_WinMain(hInst, hPrev, cmd, show); diff --git a/src/dusk/main.cpp b/src/dusk/main.cpp index 993196b34d..9d1bbc9319 100644 --- a/src/dusk/main.cpp +++ b/src/dusk/main.cpp @@ -225,7 +225,7 @@ int main(int argc, char* argv[]) { #if _WIN32 // Entry point called by the launcher executable. -extern "C" int WINAPI dusk_WinMain(HINSTANCE, HINSTANCE, PWSTR, int) { +int __declspec(dllexport) dusk_WinMain(HINSTANCE, HINSTANCE, PWSTR, int) { return RunWindowsGuiEntryPoint(); } #endif